function process_button() { global $oOrder, $oCurrencies; if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') { $my_currency = $_SESSION['currency']; } else { $my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5); } if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { $my_currency = 'EUR'; } $aPages = oos_get_pages(); $process_button_string = oos_draw_hidden_field('cmd', '_xclick') . oos_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) . oos_draw_hidden_field('item_name', oos_replace_chars(STORE_NAME)) . oos_draw_hidden_field('amount', number_format(($oOrder->info['total'] - $oOrder->info['shipping_cost']) * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency))) . oos_draw_hidden_field('first_name', oos_replace_chars($oOrder->billing['firstname'])) . oos_draw_hidden_field('last_name', oos_replace_chars($oOrder->billing['lastname'])) . oos_draw_hidden_field('address1', oos_replace_chars($oOrder->billing['street_address'])) . oos_draw_hidden_field('address2', oos_replace_chars($oOrder->billing['suburb'])) . oos_draw_hidden_field('city', oos_replace_chars($oOrder->billing['city'])) . oos_draw_hidden_field('state', oos_replace_chars($oOrder->billing['state'])) . oos_draw_hidden_field('zip', $oOrder->billing['postcode']) . oos_draw_hidden_field('lc', $oOrder->billing['country']['iso_code_2']) . oos_draw_hidden_field('email', $oOrder->customer['email_address']) . oos_draw_hidden_field('shipping', number_format($oOrder->info['shipping_cost'] * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency))) . oos_draw_hidden_field('currency_code', $my_currency) . oos_draw_hidden_field('rm', '2') . oos_draw_hidden_field('bn', 'OOS [OSIS Online Shop]') . oos_draw_hidden_field('no_note', '1'); $process_button_string .= '<input type="hidden" name="return" value="' . oos_href_link($aPages['checkout_process'], '', 'SSL') . '" >'; $process_button_string .= '<input type="hidden" name="cancel_return" value="' . oos_href_link($aPages['checkout_payment'], '', 'SSL') . '" >'; return $process_button_string; }
function process_button() { global $oOrder, $oCurrencies; if (MODULE_PAYMENT_YELLOWPAY_CURRENCY == 'Selected Currency') { $my_currency = $_SESSION['currency']; } else { $my_currency = substr(MODULE_PAYMENT_YELLOWPAY_CURRENCY, 5); } if (!in_array($my_currency, array('CHF', 'EUR', 'USD'))) { $my_currency = 'CHF'; } switch ($_SESSION['language']) { case 'deu': $usedlanguage = 2055; break; case 'eng': $usedlanguage = 2057; break; case 'ita': $usedlanguage = 2064; break; default: $usedlanguage = MODULE_PAYMENT_YELLOWPAY_LANGUAGE; break; } $sidretour = oos_session_name() . '=' . oos_session_id(); $usedtotal = number_format($oOrder->info['total'] * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency)); $txtHash_tosecure = MODULE_PAYMENT_YELLOWPAY_SHOP_ID . $my_currency . $usedtotal . MODULE_PAYMENT_HASH_SEED; $txtHash = md5($txtHash_tosecure); $txtOrderIDShop = $_SESSION['customer_id'] . date("Y-m-d H:i:s"); $process_button_string = oos_draw_hidden_field('txtShopID', MODULE_PAYMENT_YELLOWPAY_ID) . oos_draw_hidden_field('txtShopPara', $sidretour) . oos_draw_hidden_field('txtOrderTotal', $usedtotal) . oos_draw_hidden_field('txtLangVersion', $usedlanguage) . oos_draw_hidden_field('txtArtCurrency', $my_currency) . oos_draw_hidden_field('txtHash', $txtHash) . oos_draw_hidden_field('txtOrderIDShop', $txtOrderIDShop) . oos_draw_hidden_field('txtBLastName', $oOrder->billing['lastname']) . oos_draw_hidden_field('txtBFirstName', $oOrder->billing['firstname']) . oos_draw_hidden_field('txtBAddr1', $oOrder->billing['street_address']) . oos_draw_hidden_field('txtBZipCode', $oOrder->billing['postcode']) . oos_draw_hidden_field('txtBCity', oos_replace_chars($oOrder->billing['city'])) . oos_draw_hidden_field('txtBZipCode', $oOrder->billing['postcode']) . oos_draw_hidden_field('txtBTel', $oOrder->customer['customers_telephone']) . oos_draw_hidden_field('txtBEmail', $oOrder->customer['email_address']) . oos_draw_hidden_field('txtHistoryBack', '0'); return $process_button_string; }