private function getAjaxDefinitions()
 {
     $definitionsObject = new EcommerceConfigDefinitions();
     $methodArray = $definitionsObject->getAjaxMethods();
     $requestor = new ArrayData(array("ID" => "[ID]", "ClassName" => "[CLASSNAME]"));
     $obj = EcommerceConfigAjax::get_one($requestor);
     foreach ($methodArray as $method => $description) {
         if ($method != "setRequestor") {
             if (strpos($method, "lassName")) {
                 $selector = "classname";
             } else {
                 $selector = "id";
             }
             $note = "\r\n\t\t\t\t\tThis variable can be used like this: <pre>&lt;div {$selector}=\"\$AJAXDefinitions." . $method . "\"&gt;&lt;/div&gt;</pre>\r\n\t\t\t\t\t<a href=\"/shoppingcart/test/\">AJAX</a> will then use this selector to put the following content: ";
             $this->definitions["Templates"]["AJAXDefinitions_{$method}"] = $note . "<br />" . $description;
             $this->configs["Templates"]["AJAXDefinitions_{$method}"] = $obj->{$method}();
             $this->defaults["Templates"]["AJAXDefinitions_{$method}"] = "";
         }
     }
 }
 /**
  * returns the instance of EcommerceConfigAjax for use in templates.
  * In templates, it is used like this:
  * $EcommerceConfigAjax.TableID
  *
  * @return EcommerceConfigAjax
  **/
 public function AJAXDefinitions()
 {
     return EcommerceConfigAjax::get_one($this);
 }
 function getPaymentFormFields()
 {
     $ajaxObject = EcommerceConfigAjax::get_one(ShoppingCart::current_order());
     $js = "EcomCart.add_synonym(\"" . $ajaxObject->TableTotalID() . "\", \"#OrderForm_OrderForm_Amount, input[name='Amount']\");";
     Requirements::javascript("payment_buckaroo/javascript/BuckarooPayment.js");
     Requirements::customScript($js, "BuckarooPaymentModifier");
     $value = array_shift(array_flip(self::$payment_method_options_field_data));
     $order = ShoppingCart::current_order();
     if ($order) {
         if ($modifiers = $order->Modifiers("BuckarooPaymentModifier")) {
             foreach ($modifiers as $modifier) {
                 $value = $modifier->Name;
             }
         }
     }
     if (is_array(self::$payment_method_options_field_data) && count(self::$payment_method_options_field_data)) {
         return new FieldSet(new OptionsetField('BuckarooMethod', '', self::$payment_method_options_field_data, $value));
     } else {
         return new FieldSet();
     }
 }