Exemple #1
0
 function after_processing_html($orderID)
 {
     $res = '';
     $order = ordGetOrder($orderID);
     $order_amount = roundf(PaymentModule::_convertCurrency($order['order_amount'], 0, $this->_getSettingValue('CONF_CHRONOPAY_CURCODE')));
     $currency = currGetCurrencyByID($this->_getSettingValue('CONF_CHRONOPAY_CURCODE'));
     $zone_iso2 = $order['billing_state'];
     $countries = cnGetCountries(array('offset' => 0, 'CountRowOnPage' => 1000000), $count_row);
     foreach ($countries as $country) {
         if ($country['country_name'] == $order['billing_country']) {
             $country_iso3 = $country['country_iso_3'];
             $zones = znGetZones($country['countryID']);
             foreach ($zones as $zone) {
                 if ($zone['zone_name'] == $zone_iso2) {
                     $zone_iso2 = $zone['zone_code'];
                     break;
                 }
             }
             break;
         }
     }
     $post_1 = array('product_id' => $this->_getSettingValue('CONF_CHRONOPAY_PRODUCT_ID'), 'product_name' => CONF_SHOP_NAME, 'product_price' => $order_amount, 'product_price_currency' => $currency['currency_iso_3'], 'f_name' => $order['billing_firstname'], 's_name' => $order['billing_lastname'], 'street' => $order['billing_address'], 'city' => $order['billing_city'], 'state' => $zone_iso2, 'country' => $country_iso3, 'email' => $order['customer_email'], 'cb_url' => getTransactionResultURL('success'), 'cb_type' => 'P', 'decline_url' => getTransactionResultURL('failure'));
     $hidden_fields_html = '';
     reset($post_1);
     while (list($k, $v) = each($post_1)) {
         $hidden_fields_html .= '<input type="hidden" name="' . $k . '" value="' . $v . '" />' . "\n";
     }
     $res = '
                             <form method="post" action="' . xHtmlSpecialChars($this->processing_url) . '" style="text-align:center;">
                                     ' . $hidden_fields_html . '
                                     <input type="submit" value="' . CHRONOPAY_TXT_SUBMIT . '" />
                             </form>
                             ';
     return $res;
 }
Exemple #2
0
 function after_processing_html($orderID)
 {
     $res = '';
     $order = ordGetOrder($orderID);
     $order_amount = roundf(PaymentModule::_convertCurrency($order['order_amount'], 0, $this->_getSettingValue('CONF_YANDEXCPP_TRANSCURRENCY')));
     $post_1 = array('TargetCurrency' => $this->_getSettingValue('CONF_YANDEXCPP_TARGETCURRENCY'), 'currencyID' => $this->_getSettingValue('CONF_YANDEXCPP_TARGETCURRENCY'), 'wbp_InactivityPeriod' => '2', 'wbp_ShopAddress' => 'wn1.paycash.ru:8828', 'wbp_ShopEncryptionKey' => 'hAAAEicBAHV6wr3pySqE3thhKHbjvyf4XCMxKc2nSj2u8K46i0dMIP8Wd2KJHkZuhGMWZGmYAp6wsb3XqZW5HKVpamQt+t9rwGNsSaVfeZb9DM5aodCpIMHhLA8gGPDIiG4+Q15X/7Zm3MJNGavZ8+eWAnlvS1M7c6eeLTNJ0CKIYd1yHXfU', 'wbp_ShopKeyID' => '4060341894', 'wbp_Version' => '1.0', 'wbp_CorrespondentID' => '8994748E663DE6B3C68D2D9931B079C74789D4B4', 'BankID' => $this->_getSettingValue('CONF_YANDEXCPP_BANKID'), 'TargetBankID' => $this->_getSettingValue('CONF_YANDEXCPP_TARGETBANKID'), 'PaymentTypeCD' => 'PC', 'ShopID' => $this->_getSettingValue('CONF_YANDEXCPP_SHOPID'), 'CustomerNumber' => $orderID, 'Sum' => $order_amount, 'CustName' => $order['shipping_firstname'] . ' ' . $order['shipping_lastname'], 'CustAddr' => '', 'CustEMail' => $order['customer_email'], 'OrderDetails' => '');
     $order_content = ordGetOrderContent($orderID);
     foreach ($order_content as $item) {
         $post_1['OrderDetails'] .= $item['name'] . "\r\n";
     }
     $implAddress = array('shipping_country', 'shipping_state', 'shipping_city', 'shipping_address');
     foreach ($implAddress as $k) {
         if ($order[$k]) {
             $post_1['CustAddr'] .= ', ' . $order[$k];
         }
     }
     $post_1['CustAddr'] = substr($post_1['CustAddr'], 1);
     $hidden_fields_html = '';
     reset($post_1);
     while (list($k, $v) = each($post_1)) {
         $hidden_fields_html .= '<input type="hidden" name="' . $k . '" value="' . $v . '" />' . "\n";
     }
     $processing_url = $this->_getSettingValue('CONF_YANDEXCPP_MODE') == 'test' ? 'http://demomoney.yandex.ru/select-wallet.xml' : 'http://money.yandex.ru/select-wallet.xml';
     $res = '
                             <form method="post" action="' . xHtmlSpecialChars($processing_url) . '" style="text-align:center;" id="payform">
                                     ' . $hidden_fields_html . '
                             </form><table cellspacing="0" cellpadding="0" class="fsttab"><tr><td><table cellspacing="0" cellpadding="0" class="sectb"><tr><td><a href="#" onclick="document.getElementById(\'payform\').submit(); return false">' . STRING_PAY_NOW . '</a></td></tr></table></td></tr></table>';
     return $res;
 }
 /**
  * Emulate cartGetCartContent function not fully: doesnt fill feight_cost
  *
  * @return array: (cart_content, total_price, freight_cost)
  */
 function emulate_cartGetCartContent()
 {
     $cart_content = array();
     $freight_cost = 0;
     $r_aItem = $this->Items->getChildNodes('item');
     foreach ($r_aItem as $aItem) {
         /* @var $aItem xmlNodeX */
         $aProduct =& $aItem->getFirstChildByName('product');
         $aPrice =& $aItem->getFirstChildByName('price');
         $product = GetProduct($aProduct->attribute('id'));
         $strOptions = GetStrOptions($this->emulate_GetConfigurationByItemId($aItem));
         if (trim($strOptions) != '') {
             $product['name'] .= '  (' . $strOptions . ')';
         }
         $sample = $aItem->getChildData('sample');
         if ($sample == 1) {
             $product['name'] .= " [SAMPLE]";
             $q_sample_price = db_phquery('SELECT sample_price FROM SC_categories WHERE categoryID=(SELECT categoryID FROM SC_products WHERE productID=?)', $aProduct->attribute('id'));
             $sample_price = db_fetch_assoc($q_sample_price);
             $costUC = $sample_price["sample_price"];
             $quantity = 1;
             $cost = show_price($quantity * PaymentModule::_convertCurrency($costUC, $aPrice->attribute('currency'), 0), 0);
             $free_shipping = 1;
         } else {
             $costUC = $aPrice->getData();
             $cost = show_price($aItem->getChildData('quantity') * PaymentModule::_convertCurrency($aPrice->getData(), $aPrice->attribute('currency'), 0), 0);
             $quantity = $aItem->getChildData('quantity');
             $free_shipping = $aProduct->attribute('free-shipping');
         }
         $cart_content[] = array('productID' => $aProduct->attribute('id'), 'id' => $aItem->attribute('id') ? $aItem->attribute('id') : 0, 'name' => $product['name'], 'quantity' => $quantity, 'free_shipping' => $free_shipping, 'costUC' => $costUC, 'cost' => $cost, 'product_code' => $product['product_code']);
         $aFreight = $aProduct->getFirstChildByName('freight');
         if (!is_null($aFreight)) {
             $freight_cost += $aItem->getChildData('quantity') * virtualModule::_convertCurrency($aFreight->getData(), $aFreight->attribute('currency'), 0);
         }
     }
     $cart = array('cart_content' => $cart_content, 'total_price' => $this->calculateTotalPrice(), 'freight_cost' => $freight_cost);
     return $cart;
 }