/**
  * Generate payment authorization form and AUTH or CAPTURE
  *
  * @access 	public
  * @param 	object
  * @return	mixed
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $objTemplate = new \Isotope\Template($this->strTemplate);
     $objTemplate->setData($this->arrData);
     $objTemplate->headline = specialchars($GLOBALS['TL_LANG']['MODEL']['tl_iso_payment.purchaseorder'][0]);
     return $objTemplate->parse();
 }
Example #2
0
 /**
  * Return the payment form
  * @param   IsotopeProductCollection    The order being places
  * @param   Module                      The checkout module instance
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $strCountry = in_array($objOrder->getBillingAddress()->country, array('de', 'ch', 'at')) ? $objOrder->getBillingAddress()->country : 'de';
     $strUrl = 'https://www.sofortueberweisung.' . $strCountry . '/payment/start';
     $arrParams = array('user_id' => $this->sofortueberweisung_user_id, 'project_id' => $this->sofortueberweisung_project_id, 'sender_holder' => '', 'sender_account_number' => '', 'sender_bank_code' => '', 'sender_country_id' => strtoupper($objOrder->getBillingAddress()->country), 'amount' => number_format($objOrder->getTotal(), 2, '.', ''), 'currency_id' => $objOrder->currency, 'reason_1' => \Environment::get('host'), 'reason_2' => '', 'user_variable_0' => $objOrder->id, 'user_variable_1' => $this->id, 'user_variable_2' => $objOrder->uniqid, 'user_variable_3' => '', 'user_variable_4' => '', 'user_variable_5' => '', 'project_password' => $this->sofortueberweisung_project_password);
     $arrParams['hash'] = sha1(implode('|', $arrParams));
     $arrParams['language_id'] = $GLOBALS['TL_LANGUAGE'];
     $objTemplate = new \Isotope\Template('iso_payment_sofortueberweisung');
     $objTemplate->setData($this->arrData);
     $objTemplate->action = $strUrl;
     $objTemplate->params = array_filter(array_diff_key($arrParams, array('project_password' => '')));
     return $objTemplate->parse();
 }
 /**
  * Return the payment form
  * @param   IsotopeProductCollection    The order being places
  * @param   Module                      The checkout module instance
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     // get current host and
     $strDescription = \Environment::get('host');
     $objContact = \PageModel::findWithDetails($this->wirecard_contact);
     $arrParams = array('customerId' => $this->wirecard_customer_id, 'language' => $GLOBALS['TL_LANGUAGE'], 'paymentType' => 'SELECT', 'amount' => number_format($objOrder->getTotal(), 2, '.', ''), 'currency' => $objOrder->currency, 'orderDescription' => $strDescription, 'successUrl' => \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder), 'cancelUrl' => \Environment::get('base') . $objModule->generateUrlForStep('process'), 'failureUrl' => \Environment::get('base') . $objModule->generateUrlForStep('failed'), 'serviceUrl' => \Environment::get('base') . \Controller::generateFrontendUrl($objContact->row()), 'confirmUrl' => \Environment::get('base') . 'system/modules/isotope/postsale.php?mod=pay&id=' . $this->id, 'customerStatement' => $strDescription, 'order_id' => $objOrder->id, 'order_uniqid' => $objOrder->uniqid, 'secret' => $this->wirecard_secret, 'REQUEST_TOKEN' => REQUEST_TOKEN);
     $arrParams['requestFingerprintOrder'] = implode(',', array_keys($arrParams)) . ',requestFingerprintOrder';
     $arrParams['requestFingerprint'] = $this->calcHashArray($arrParams);
     $objTemplate = new \Isotope\Template('iso_payment_wirecard');
     $objTemplate->setData($this->arrData);
     $objTemplate->action = 'https://checkout.wirecard.com/page/init.php';
     $objTemplate->params = array_filter(array_diff_key($arrParams, array('secret' => '')));
     return $objTemplate->parse();
 }
Example #4
0
 /**
  * Generate the submit form for Innopay and if javascript is enabled redirect automatically
  *
  * @param   IsotopeProductCollection|Order   $objOrder  The order being placed
  * @param   \Module|\Isotope\Module\Checkout $objModule The checkout module instance
  *
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $parameters = $this->getOutboundParameters($objOrder, $objModule);
     $parameters['signature'] = $this->calculateSignature($parameters, $this->vads_certificate);
     $objTemplate = new \Isotope\Template($this->strTemplate);
     $objTemplate->id = $this->id;
     $objTemplate->params = $parameters;
     $objTemplate->headline = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][0]);
     $objTemplate->message = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][1]);
     $objTemplate->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][2]);
     $objTemplate->noscript = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][3]);
     return $objTemplate->parse();
 }
Example #5
0
 /**
  * Return the redirect form.
  * @param   IsotopeProductCollection    The order being places
  * @param   Module                      The checkout module instance
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $objTemplate = new \Isotope\Template('iso_payment_paybyway');
     $objTemplate->action = 'https://www.paybyway.com/e-payments/pay';
     $objTemplate->headline = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][0]);
     $objTemplate->message = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][1]);
     $objTemplate->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][2]);
     $objTemplate->noscript = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][3]);
     $objTemplate->merchant_id = (int) $this->paybyway_merchant_id;
     $objTemplate->amount = round($objOrder->getTotal() * 100);
     $objTemplate->currency = 'EUR';
     $objTemplate->order_number = $objOrder->id;
     $objTemplate->lang = $GLOBALS['TL_LANGUAGE'] == 'fi' ? 'FI' : 'EN';
     $objTemplate->return_address = \Environment::get('base') . 'system/modules/isotope/postsale.php?mod=pay&id=' . $this->id;
     $objTemplate->cancel_address = \Environment::get('base') . 'system/modules/isotope/postsale.php?mod=pay&id=' . $this->id;
     if ($this->debug) {
         $objTemplate->action = 'https://www.paybyway.com/e-payments/test_pay';
         $this->paybyway_private_key = 'private_key';
     }
     $objTemplate->authcode = strtoupper(md5($this->paybyway_private_key . '|' . $objTemplate->merchant_id . '|' . $objTemplate->amount . '|' . $objTemplate->currency . '|' . $objTemplate->order_number . '|' . $objTemplate->lang . '|' . $objTemplate->return_address . '|' . $objTemplate->cancel_address));
     return $objTemplate->parse();
 }
Example #6
0
 /**
  * Generates the filter
  */
 protected function generateFilter()
 {
     $blnShowClear = false;
     $arrFilters = array();
     foreach ($this->iso_filterFields as $strField) {
         $blnTrail = false;
         $arrItems = array();
         $arrWidget = \Widget::getAttributesFromDca($GLOBALS['TL_DCA']['tl_iso_product']['fields'][$strField], $strField);
         // Use the default routine to initialize options data
         foreach ($arrWidget['options'] as $option) {
             $varValue = $option['value'];
             // skip zero values (includeBlankOption)
             // @deprecated drop "-" when we only have the database table as options source
             if ($varValue === '' || $varValue === '-') {
                 continue;
             }
             $strFilterKey = $strField . '=' . $varValue;
             $blnActive = Isotope::getRequestCache()->getFilterForModule($strFilterKey, $this->id) !== null;
             $blnTrail = $blnActive ? true : $blnTrail;
             $arrItems[] = array('href' => \Haste\Util\Url::addQueryString('cumulativefilter=' . base64_encode($this->id . ';' . ($blnActive ? 'del' : 'add') . ';' . $strField . ';' . $varValue)), 'class' => $blnActive ? 'active' : '', 'title' => specialchars($option['label']), 'link' => $option['label']);
         }
         if (!empty($arrItems) || $this->iso_iso_filterHideSingle && count($arrItems) < 2) {
             $objClass = RowClass::withKey('class')->addFirstLast();
             if ($blnTrail) {
                 $objClass->addCustom('sibling');
             }
             $objClass->applyTo($arrItems);
             $objTemplate = new \Isotope\Template($this->navigationTpl);
             $objTemplate->level = 'level_2';
             $objTemplate->items = $arrItems;
             $arrFilters[$strField] = array('label' => $arrWidget['label'], 'subitems' => $objTemplate->parse(), 'isActive' => $blnTrail);
             $blnShowClear = $blnTrail ? true : $blnShowClear;
         }
     }
     $this->Template->filters = $arrFilters;
     $this->Template->showClear = $blnShowClear;
 }
 /**
  * Generate the checkout step
  * @return  string
  */
 public function generate()
 {
     $arrModules = array();
     $arrOptions = array();
     $arrIds = deserialize($this->objModule->iso_payment_modules);
     if (!empty($arrIds) && is_array($arrIds)) {
         $arrColumns = array('id IN (' . implode(',', $arrIds) . ')');
         if (BE_USER_LOGGED_IN !== true) {
             $arrColumns[] = "enabled='1'";
         }
         /** @type Payment[] $objModules */
         $objModules = Payment::findBy($arrColumns, null, array('order' => \Database::getInstance()->findInSet('id', $arrIds)));
         if (null !== $objModules) {
             foreach ($objModules as $objModule) {
                 if (!$objModule->isAvailable()) {
                     continue;
                 }
                 $strLabel = $objModule->getLabel();
                 $fltPrice = $objModule->getPrice();
                 if ($fltPrice != 0) {
                     if ($objModule->isPercentage()) {
                         $strLabel .= ' (' . $objModule->getPercentageLabel() . ')';
                     }
                     $strLabel .= ': ' . Isotope::formatPriceWithCurrency($fltPrice);
                 }
                 if ($objModule->note != '') {
                     $strLabel .= '<span class="note">' . $objModule->note . '</span>';
                 }
                 $arrOptions[] = array('value' => $objModule->id, 'label' => $strLabel);
                 $arrModules[$objModule->id] = $objModule;
             }
         }
     }
     if (empty($arrModules)) {
         $this->blnError = true;
         \System::log('No payment methods available for cart ID ' . Isotope::getCart()->id, __METHOD__, TL_ERROR);
         $objTemplate = new \Isotope\Template('mod_message');
         $objTemplate->class = 'payment_method';
         $objTemplate->hl = 'h2';
         $objTemplate->headline = $GLOBALS['TL_LANG']['MSC']['payment_method'];
         $objTemplate->type = 'error';
         $objTemplate->message = $GLOBALS['TL_LANG']['MSC']['noPaymentModules'];
         return $objTemplate->parse();
     }
     $strClass = $GLOBALS['TL_FFL']['radio'];
     /** @type \Widget $objWidget */
     $objWidget = new $strClass(array('id' => $this->getStepClass(), 'name' => $this->getStepClass(), 'mandatory' => true, 'options' => $arrOptions, 'value' => Isotope::getCart()->payment_id, 'storeValues' => true, 'tableless' => true));
     // If there is only one payment method, mark it as selected by default
     if (count($arrModules) == 1) {
         $objModule = reset($arrModules);
         $objWidget->value = $objModule->id;
         Isotope::getCart()->setPaymentMethod($objModule);
     }
     if (\Input::post('FORM_SUBMIT') == $this->objModule->getFormId()) {
         $objWidget->validate();
         if (!$objWidget->hasErrors()) {
             Isotope::getCart()->setPaymentMethod($arrModules[$objWidget->value]);
         }
     }
     $objTemplate = new \Isotope\Template('iso_checkout_payment_method');
     if (!Isotope::getCart()->hasPayment() || !isset($arrModules[Isotope::getCart()->payment_id])) {
         $this->blnError = true;
     }
     $objTemplate->headline = $GLOBALS['TL_LANG']['MSC']['payment_method'];
     $objTemplate->message = $GLOBALS['TL_LANG']['MSC']['payment_method_message'];
     $objTemplate->options = $objWidget->parse();
     $objTemplate->paymentMethods = $arrModules;
     return $objTemplate->parse();
 }
Example #8
0
 /**
  * Return the ePay form
  *
  * @param IsotopeProductCollection|Order   $objOrder
  * @param \Module|\Isotope\Module\Checkout $objModule
  *
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $objTemplate = new \Isotope\Template('iso_payment_epay');
     $objTemplate->setData($this->arrData);
     $objTemplate->currency = $objOrder->currency;
     $objTemplate->amount = Currency::getAmountInMinorUnits($objOrder->getTotal(), $objOrder->currency);
     $objTemplate->orderid = $objOrder->id;
     $objTemplate->instantcapture = $this->trans_type == 'capture' ? '1' : '0';
     $objTemplate->callbackurl = \Environment::get('base') . 'system/modules/isotope/postsale.php?mod=pay&id=' . $this->id;
     $objTemplate->accepturl = \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder);
     $objTemplate->cancelurl = \Environment::get('base') . $objModule->generateUrlForStep('failed');
     $objTemplate->language = (int) static::$arrLanguages[substr($GLOBALS['TL_LANGUAGE'], 0, 2)];
     return $objTemplate->parse();
 }
Example #9
0
 /**
  * HTML form for checkout
  * @param   IsotopeProductCollection    The order being places
  * @param   Module                      The checkout module instance
  * @return  mixed
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $i = 0;
     $arrData = array('aid' => $this->payone_aid, 'portalid' => $this->payone_portalid, 'mode' => $this->debug ? 'test' : 'live', 'request' => $this->trans_type == 'auth' ? 'preauthorization' : 'authorization', 'encoding' => 'UTF-8', 'clearingtype' => $this->payone_clearingtype, 'reference' => $objOrder->id, 'display_name' => 'no', 'display_address' => 'no', 'successurl' => \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder), 'backurl' => \Environment::get('base') . $objModule->generateUrlForStep('failed'), 'amount' => $objOrder->getTotal() * 100, 'currency' => $objOrder->currency, 'param' => 'paymentMethodPayone' . $this->id);
     foreach ($objOrder->getItems() as $objItem) {
         // Set the active product for insert tags replacement
         if ($objItem->hasProduct()) {
             Product::setActive($objItem->getProduct());
         }
         $strOptions = '';
         $arrOptions = Isotope::formatOptions($objItem->getOptions());
         Product::unsetActive();
         if (!empty($arrOptions)) {
             array_walk($arrOptions, function (&$option) {
                 $option = $option['label'] . ': ' . $option['value'];
             });
             $strOptions = ' (' . implode(', ', $arrOptions) . ')';
         }
         $arrData['id[' . ++$i . ']'] = $objItem->getSku();
         $arrData['pr[' . $i . ']'] = round($objItem->getPrice(), 2) * 100;
         $arrData['no[' . $i . ']'] = $objItem->quantity;
         $arrData['de[' . $i . ']'] = specialchars($objItem->getName() . $strOptions);
     }
     foreach ($objOrder->getSurcharges() as $k => $objSurcharge) {
         if (!$objSurcharge->addToTotal) {
             continue;
         }
         $arrData['id[' . ++$i . ']'] = 'surcharge' . $k;
         $arrData['pr[' . $i . ']'] = $objSurcharge->total_price * 100;
         $arrData['no[' . $i . ']'] = '1';
         $arrData['de[' . $i . ']'] = $objSurcharge->label;
     }
     ksort($arrData);
     // Do not urlencode values because Payone does not properly decode POST values (whatever...)
     $strHash = md5(implode('', $arrData) . $this->payone_key);
     $objTemplate = new \Isotope\Template('iso_payment_payone');
     $objTemplate->id = $this->id;
     $objTemplate->data = $arrData;
     $objTemplate->hash = $strHash;
     $objTemplate->billing_address = $objOrder->getBillingAddress()->row();
     $objTemplate->headline = $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][0];
     $objTemplate->message = $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][1];
     $objTemplate->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][2]);
     return $objTemplate->parse();
 }
Example #10
0
 /**
  * Return the PayPal form.
  * @param   IsotopeProductCollection    The order being places
  * @param   Module                      The checkout module instance
  * @return  string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $arrData = array();
     $fltDiscount = 0;
     $i = 0;
     foreach ($objOrder->getItems() as $objItem) {
         // Set the active product for insert tags replacement
         if ($objItem->hasProduct()) {
             Product::setActive($objItem->getProduct());
         }
         $strOptions = '';
         $arrOptions = Isotope::formatOptions($objItem->getOptions());
         Product::unsetActive();
         if (!empty($arrOptions)) {
             array_walk($arrOptions, function (&$option) {
                 $option = $option['label'] . ': ' . $option['value'];
             });
             $strOptions = ' (' . implode(', ', $arrOptions) . ')';
         }
         $arrData['item_number_' . ++$i] = $objItem->getSku();
         $arrData['item_name_' . $i] = $objItem->getName() . $strOptions;
         $arrData['amount_' . $i] = $objItem->getPrice();
         $arrData['quantity_' . $i] = $objItem->quantity;
     }
     foreach ($objOrder->getSurcharges() as $objSurcharge) {
         if (!$objSurcharge->addToTotal) {
             continue;
         }
         // PayPal does only support one single discount item
         if ($objSurcharge->total_price < 0) {
             $fltDiscount -= $objSurcharge->total_price;
             continue;
         }
         $arrData['item_name_' . ++$i] = $objSurcharge->label;
         $arrData['amount_' . $i] = $objSurcharge->total_price;
     }
     $objTemplate = new \Isotope\Template('iso_payment_paypal');
     $objTemplate->setData($this->arrData);
     $objTemplate->id = $this->id;
     $objTemplate->action = 'https://www.' . ($this->debug ? 'sandbox.' : '') . 'paypal.com/cgi-bin/webscr';
     $objTemplate->invoice = $objOrder->id;
     $objTemplate->data = array_map('specialchars', $arrData);
     $objTemplate->discount = $fltDiscount;
     $objTemplate->address = $objOrder->getBillingAddress();
     $objTemplate->currency = $objOrder->currency;
     $objTemplate->return = \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder);
     $objTemplate->cancel_return = \Environment::get('base') . $objModule->generateUrlForStep('failed');
     $objTemplate->notify_url = \Environment::get('base') . 'system/modules/isotope/postsale.php?mod=pay&id=' . $this->id;
     $objTemplate->headline = $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][0];
     $objTemplate->message = $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][1];
     $objTemplate->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][2]);
     return $objTemplate->parse();
 }
Example #11
0
 /**
  * Generate a product template
  * @param   array
  * @return  string
  */
 public function generate(array $arrConfig)
 {
     $this->strFormId = ($arrConfig['module'] instanceof \ContentElement ? 'cte' : 'fmd') . $arrConfig['module']->id . '_product_' . $this->getProductId();
     $objProduct = $this->validateVariant();
     // A variant has been loaded, generate the variant
     if ($objProduct->id != $this->id) {
         return $objProduct->generate($arrConfig);
     }
     $arrGalleries = array();
     $objTemplate = new \Isotope\Template($arrConfig['template']);
     $objTemplate->setData($this->arrData);
     $objTemplate->product = $this;
     $objTemplate->config = $arrConfig;
     $objTemplate->generateAttribute = function ($strAttribute, array $arrOptions = array()) use($objProduct) {
         $objAttribute = $GLOBALS['TL_DCA']['tl_iso_product']['attributes'][$strAttribute];
         if (!$objAttribute instanceof IsotopeAttribute) {
             throw new \InvalidArgumentException($strAttribute . ' is not a valid attribute');
         }
         return $objAttribute->generate($objProduct, $arrOptions);
     };
     $objTemplate->generatePrice = function () use($objProduct) {
         $objPrice = $objProduct->getPrice();
         if (null === $objPrice) {
             return '';
         }
         return $objPrice->generate($objProduct->getRelated('type')->showPriceTiers());
     };
     $objTemplate->getGallery = function ($strAttribute) use($objProduct, $arrConfig, &$arrGalleries) {
         if (!isset($arrGalleries[$strAttribute])) {
             $arrGalleries[$strAttribute] = Gallery::createForProductAttribute($objProduct, $strAttribute, $arrConfig);
         }
         return $arrGalleries[$strAttribute];
     };
     $arrVariantOptions = array();
     $arrProductOptions = array();
     $arrAjaxOptions = array();
     foreach (array_unique(array_merge($this->getAttributes(), $this->getVariantAttributes())) as $attribute) {
         $arrData = $GLOBALS['TL_DCA']['tl_iso_product']['fields'][$attribute];
         if ($arrData['attributes']['customer_defined'] || $arrData['attributes']['variant_option']) {
             $strWidget = $this->generateProductOptionWidget($attribute, $arrVariantOptions);
             if ($strWidget != '') {
                 $objTemplate->hasOptions = true;
                 $arrProductOptions[$attribute] = array_merge($arrData, array('name' => $attribute, 'html' => $strWidget));
                 if ($arrData['attributes']['variant_option'] || $arrData['attributes']['ajax_option']) {
                     $arrAjaxOptions[] = $attribute;
                 }
             }
         }
     }
     $arrButtons = array();
     // !HOOK: retrieve buttons
     if (isset($GLOBALS['ISO_HOOKS']['buttons']) && is_array($GLOBALS['ISO_HOOKS']['buttons'])) {
         foreach ($GLOBALS['ISO_HOOKS']['buttons'] as $callback) {
             $objCallback = \System::importStatic($callback[0]);
             $arrButtons = $objCallback->{$callback}[1]($arrButtons);
         }
         $arrButtons = array_intersect_key($arrButtons, array_flip($arrConfig['buttons']));
     }
     if (\Input::post('FORM_SUBMIT') == $this->getFormId() && !$this->doNotSubmit) {
         foreach ($arrButtons as $button => $data) {
             if (\Input::post($button) != '') {
                 if (isset($data['callback'])) {
                     $objCallback = \System::importStatic($data['callback'][0]);
                     $objCallback->{$data['callback'][1]}($this, $arrConfig);
                 }
                 break;
             }
         }
     }
     RowClass::withKey('rowClass')->addCustom('product_option')->addFirstLast()->addEvenOdd()->applyTo($arrProductOptions);
     $objTemplate->buttons = $arrButtons;
     $objTemplate->useQuantity = $arrConfig['useQuantity'];
     $objTemplate->minimum_quantity = $this->getMinimumQuantity();
     $objTemplate->raw = $this->arrData;
     $objTemplate->raw_options = $this->getOptions();
     $objTemplate->href = $this->generateUrl($arrConfig['jumpTo']);
     $objTemplate->label_detail = $GLOBALS['TL_LANG']['MSC']['detailLabel'];
     $objTemplate->options = $arrProductOptions;
     $objTemplate->hasOptions = !empty($arrProductOptions);
     $objTemplate->enctype = $this->hasUpload ? 'multipart/form-data' : 'application/x-www-form-urlencoded';
     $objTemplate->formId = $this->getFormId();
     $objTemplate->action = ampersand(\Environment::get('request'), true);
     $objTemplate->formSubmit = $this->getFormId();
     $objTemplate->product_id = $this->getProductId();
     $objTemplate->module_id = $arrConfig['module']->id;
     $GLOBALS['AJAX_PRODUCTS'][] = array('formId' => $this->getFormId(), 'attributes' => $arrAjaxOptions);
     // !HOOK: alter product data before output
     if (isset($GLOBALS['ISO_HOOKS']['generateProduct']) && is_array($GLOBALS['ISO_HOOKS']['generateProduct'])) {
         foreach ($GLOBALS['ISO_HOOKS']['generateProduct'] as $callback) {
             $objCallback = \System::importStatic($callback[0]);
             $objCallback->{$callback}[1]($objTemplate, $this);
         }
     }
     return $objTemplate->parse();
 }
Example #12
0
 /**
  * HTML form for checkout
  * @param object
  * @param object
  * @return string
  */
 public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule)
 {
     $time = time();
     $strSessionId = $objOrder->id . '_' . uniqid();
     $objAddress = $objOrder->getBillingAddress();
     $intPrice = round($objOrder->getTotal(), 2) * 100;
     $strDescription = sprintf($GLOBALS['TL_LANG']['MSC']['payu_order'], $objOrder->uniqid);
     $objTemplate = new \Isotope\Template('iso_payment_payu');
     $objTemplate->setData($this->arrData);
     $objTemplate->id = $this->id;
     $objTemplate->order_id = $objOrder->uniqid;
     $objTemplate->ts = $time;
     $objTemplate->amount = $intPrice;
     $objTemplate->session_id = $strSessionId;
     $objTemplate->desc = specialchars($strDescription);
     $objTemplate->sig = md5($this->payu_id . ($this->debug ? 't' : '') . $strSessionId . $this->payu_authKey . $intPrice . $strDescription . $objOrder->uniqid . $objAddress->firstname . $objAddress->lastname . $objAddress->street_1 . $objAddress->city . $objAddress->postal . $objAddress->country . $objAddress->email . $objAddress->phone . $GLOBALS['TL_LANGUAGE'] . \Environment::get('ip') . $time . $this->payu_key1);
     $objTemplate->ip = \Environment::get('ip');
     $objTemplate->language = $GLOBALS['TL_LANGUAGE'];
     $objTemplate->address = $objAddress;
     $objTemplate->headline = $GLOBALS['TL_LANG']['MSC']['pay_with_payu'][0];
     $objTemplate->message = $GLOBALS['TL_LANG']['MSC']['pay_with_payu'][1];
     $objTemplate->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['pay_with_payu'][2]);
     return $objTemplate->parse();
 }