* license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'process_embedded') { if (!empty($_REQUEST['data'])) { $data = json_decode($_REQUEST['data'], true); if (!empty($data)) { fn_create_payment_form($data['submit_url'], $data['data'], $data['payment_name'], $data['exclude_empty_values'], $data['method']); } } exit; } } if (!empty($_REQUEST['payment'])) { define('PAYMENT_NOTIFICATION', true); $payment = fn_basename($_REQUEST['payment']); if (fn_check_prosessor_status($payment)) { $payment_script = fn_get_processor_script_path($payment . '.php'); if (in_array($mode, array('checkout_redirect', 'index_redirect'))) { fn_order_placement_routines($mode); } elseif (is_file($payment_script)) { include $payment_script; }
2 - Confirmation 3 -Automatic Refund 4 - Payment by Cell Phone 5 - Recurrent Transaction 6 - Successive Transaction 7 - Authentication 8 - Confirmation of Authentication */ $currency = $processor_data['processor_params']['currency']; $merchant = $processor_data['processor_params']['merchant_id']; $terminal = $processor_data['processor_params']['terminal']; $transaction_type = 0; // authorization $clave = $processor_data['processor_params']['clave']; $postfix = fn_date_format(time(), '%S'); if (strlen($order_id) > 6) { $order_n = $order_id . $postfix . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : ''); } else { $order_n = str_repeat('0', 6 - strlen($order_id)) . $order_id . $postfix . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : ''); } $amount = $currency == '978' ? $order_info['total'] * 100 : $order_info['total']; $url_merchant = fn_url("payment_notification.result?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current'); $url_ok = fn_url("payment_notification.notify?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current'); $url_nok = fn_url("payment_notification.failed?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current'); // Compute hash to sign form data $message = $amount . $order_n . $merchant . $currency . $transaction_type . $url_merchant . $clave; $signature = strtoupper(sha1($message)); $post_data = array('Ds_Merchant_Amount' => $amount, 'Ds_Merchant_Currency' => $currency, 'Ds_Merchant_Order' => $order_n, 'Ds_Merchant_MerchantCode' => $merchant, 'Ds_Merchant_Terminal' => $terminal, 'Ds_Merchant_TransactionType' => $transaction_type, 'Ds_Merchant_MerchantURL' => $url_merchant, 'Ds_Merchant_UrlOK' => $url_ok, 'Ds_Merchant_UrlKO' => $url_nok, 'Ds_Merchant_MerchantSignature' => $signature); fn_create_payment_form($post_address, $post_data, 'SERMEPA'); } exit;
$post_data['postal_code'] = $order_info['b_zipcode']; $post_data['city'] = $order_info['b_city']; $post_data['state'] = fn_get_state_name($order_info['b_state'], $order_info['b_country']); if (empty($post_data['state'])) { $post_data['state'] = $order_info['b_state']; } if (fn_strlen($post_data['state']) > 50) { $post_data['state'] = fn_substr($post_data['state'], 0, 47) . '...'; } $post_data['country'] = db_get_field('SELECT code_A3 FROM ?:countries WHERE code=?s', $order_info['b_country']); $post_data['phone_number'] = $order_info['phone']; if ($processor_data['processor_params']['quick_checkout'] == 'Y') { $post_data['payment_methods'] = !empty($processor_data['processor_params']['payment_methods']) ? '' : 'ACC'; $post_data['hide_login'] = '******'; } else { $post_data['payment_methods'] = 'WLT'; $post_data['hide_login'] = !empty($suffix) ? '1' : '0'; } // split_gateway if (!empty($processor_data['processor_params']['payment_methods'])) { $post_data['payment_methods'] .= (!empty($post_data['payment_methods']) ? ',' : '') . $processor_data['processor_params']['payment_methods']; } // /split_gateway // logo if (!(!empty($processor_data['processor_params']['do_not_pass_logo']) && $processor_data['processor_params']['do_not_pass_logo'] == 'Y')) { $logos = fn_get_logos(); $post_data['logo_url'] = $logos['theme']['image']['image_path']; } fn_create_payment_form($url, $post_data, 'Skrill'); exit; }
fn_finish_payment($_REQUEST['order_id'], $pp_response); fn_order_placement_routines('route', $_REQUEST['order_id']); exit; } else { $order_prefix = !empty($processor_data['processor_params']['order_prefix']) ? $processor_data['processor_params']['order_prefix'] : ''; $return_url = fn_url("payment_notification.notify?payment=eway_shared&order_id={$order_id}", AREA, 'current'); $MerchantInvoice = $order_prefix . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id); if ($processor_data['processor_params']['gateway'] == 'payment') { $currency = 'GBP'; } elseif ($processor_data['processor_params']['gateway'] == 'nz') { $currency = 'NZD'; } else { $currency = 'AUD'; } $request_url = 'https://' . $processor_data['processor_params']['gateway'] . '.ewaygateway.com/Request/?' . 'CustomerID=' . $processor_data['processor_params']['customer_id'] . '&UserName='******'processor_params']['username'] . '&Amount=' . fn_format_price($order_info['total'], $currency, 2, false) . '&Currency=' . $currency . '&ReturnURL=' . urlencode($return_url) . '&CancelURL=' . urlencode($return_url) . '&InvoiceDescription=' . (!empty($order_info['notice']) ? $order_info['notice'] : '') . '&CompanyName=' . urlencode(Registry::get('settings.Company.company_name')) . '&CustomerFirstName=' . urlencode($order_info['b_firstname']) . '&CustomerLastName=' . urlencode($order_info['b_lastname']) . '&CustomerAddress=' . urlencode($order_info['b_address']) . '&CustomerCity=' . urlencode($order_info['b_city']) . '&CustomerState=' . urlencode($order_info['b_state_descr']) . '&CustomerPostCode=' . urlencode($order_info['b_zipcode']) . '&CustomerCountry=' . urlencode($order_info['b_country_descr']) . '&CustomerPhone=' . urlencode($order_info['phone']) . '&CustomerEmail=' . urlencode($order_info['email']) . '&MerchantReference=' . urlencode($MerchantInvoice); $return = Http::get($request_url); $sucessfull = 'False'; if (preg_match("/<Result>(.*)<\\/Result>/", $return, $matches)) { $sucessfull = $matches[1]; } if ($sucessfull == 'True') { if (preg_match("/<URI>(.*)<\\/URI>/", $return, $matches)) { fn_create_payment_form($matches[1], array(), '', true, 'get'); } } else { if (preg_match("/<Error>(.*)<\\/Error>/", $return, $matches)) { $pp_response['reason_text'] = $matches[1]; } $pp_response['order_status'] = 'D'; } }
if (!defined('BOOTSTRAP')) { die('Access denied'); } if (defined('PAYMENT_NOTIFICATION')) { if ($mode == 'frame' && !empty(Tygh::$app['session']['cmpi']['acs_url'])) { fn_create_payment_form(Tygh::$app['session']['cmpi']['acs_url'], Tygh::$app['session']['cmpi']['frame_data'], 'Card Issuer', false, 'post', false); exit; } elseif ($mode == 'bank' && !empty(Tygh::$app['session']['cmpi']['order_id'])) { $order_info = fn_get_order_info(Tygh::$app['session']['cmpi']['order_id']); $processor_data = fn_get_processor_data($order_info['payment_method']['payment_id']); $payment_name = str_replace('.php', '', $processor_data['processor_script']); Tygh::$app['session']['cmpi']['pares'] = !empty($_REQUEST['PaRes']) ? $_REQUEST['PaRes'] : ''; $sess = Tygh::$app['session']->getName() . '=' . Tygh::$app['session']->getID(); $src = fn_url("payment_notification.auth?payment={$payment_name}&{$sess}", AREA, 'current'); $msg = __('text_cc_processor_connection', array('[processor]' => '3-D Secure server')); fn_create_payment_form($src, array(), '3-D Secure', false, 'get', false, 'parent'); exit; } elseif ($mode == 'auth' && !empty(Tygh::$app['session']['cmpi']['order_id'])) { $view = Tygh::$app['view']; $view->assign('order_action', __('placing_order')); $view->display('views/orders/components/placing_order.tpl'); fn_flush(); fn_cmpi_authenticate(); if (Tygh::$app['session']['cmpi']['signature'] == 'Y' && in_array(Tygh::$app['session']['cmpi']['pares'], array('Y', 'A', 'U'))) { define('DO_DIRECT_PAYMENT', true); } else { Tygh::$app['session']['cmpi']['auth_error'] = true; fn_set_notification('E', __('authentication_failed'), __('text_authentication_failed_message')); } define('CMPI_PROCESSED', true); fn_start_payment(Tygh::$app['session']['cmpi']['order_id']);
// still waiting for the response } else { $pp_response['order_status'] = 'F'; } fn_finish_payment($_REQUEST['brq_invoicenumber'], $pp_response, false); $route = $order_info['repaid'] ? 'repay' : 'route'; fn_order_placement_routines($route, $_REQUEST['brq_invoicenumber']); } } else { $currency_coefficient = Registry::get('currencies.' . CART_SECONDARY_CURRENCY . '.coefficient'); $_order_total = !empty($currency_coefficient) ? $order_info['total'] / floatval($currency_coefficient) : $order_info['total']; $return_url = fn_url("payment_notification.notify?payment=ideal_xml", AREA, 'current'); $params = array('brq_websitekey' => $processor_data['processor_params']['merchant_id'], 'brq_amount' => $_order_total, 'brq_culture' => CART_LANGUAGE, 'brq_currency' => CART_SECONDARY_CURRENCY, 'brq_invoicenumber' => $order_id, 'brq_description' => $processor_data['processor_params']['description'], 'brq_return' => $return_url, 'brq_returnreject' => $return_url, 'brq_returnerror' => $return_url, 'brq_returncancel' => $return_url); $params['brq_signature'] = fn_buckaroo_calculate_signature($params, $processor_data['processor_params']['merchant_key']); $post_url = empty($processor_data['processor_params']['test']) ? "https://checkout.buckaroo.nl/html/" : "https://testcheckout.buckaroo.nl/html/"; fn_create_payment_form($post_url, $params, 'Buckaroo server', false); exit; } function fn_buckaroo_calculate_signature($params, $secret_key) { unset($params['brq_signature']); unset($params['dispatch']); unset($params['payment']); //sort the array $sortable_array = fn_buckaroo_sort($params); //turn into string and add the secret key to the end $signature_string = ''; foreach ($sortable_array as $key => $value) { $value = urldecode($value); $signature_string .= $key . '=' . $value; }
$PxAccess_Url = "https://sec.paymentexpress.com/pxpay/pxpay.aspx"; $PxAccess_Userid = $processor_data["processor_params"]["user_id"]; //Change to your user ID $PxAccess_Key = $processor_data["processor_params"]["key"]; //Your DES Key from DPS $Mac_Key = $processor_data["processor_params"]["mac_key"]; //Your MAC key from DPS $pxaccess = new PxAccess($PxAccess_Url, $PxAccess_Userid, $PxAccess_Key, $Mac_Key); $request = new PxPayRequest(); $script_url = fn_payment_url('current', 'dps_access.php'); $_order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id; Tygh::$app['session']['dps_access']['order_id'] = $order_id; //Set up PxPayRequest Object $request->setAmountInput($order_info['total']); $request->setTxnData1(""); // whatever you want to appear $request->setTxnData2(""); // whatever you want to appear $request->setTxnData3(""); // whatever you want to appear $request->setTxnType("Purchase"); $request->setInputCurrency($processor_data["processor_params"]["currency"]); $request->setMerchantReference($_order_id); // fill this with your order number $request->setEmailAddress($order_info['email']); $request->setUrlFail($script_url); $request->setUrlSuccess($script_url); //Call makeResponse of PxAccess object to obtain the 3-DES encrypted payment request $request_string = $pxaccess->makeRequest($request); fn_create_payment_form($request_string, array(), 'DPS server', true, 'get'); }
****************************************************************************/ if (!defined('BOOTSTRAP')) { require './init_payment.php'; $order_id = strpos($_REQUEST['strCartID'], '_') ? substr($_REQUEST['strCartID'], 0, strpos($_REQUEST['strCartID'], '_')) : $_REQUEST['strCartID']; if (!isset($_REQUEST['intAccountID'])) { fn_order_placement_routines('route', $order_id); } else { $pp_response = array(); if (empty($_REQUEST['intStatus'])) { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = __('failed'); } elseif ($_REQUEST['intStatus'] == 1) { $pp_response['order_status'] = 'P'; $pp_response['reason_text'] = __('order_id') . '-' . $order_id; } else { $pp_response['order_status'] = 'N'; $pp_response['reason_text'] = __('cancelled'); } $pp_response['transaction_id'] = $_REQUEST['intTransID']; if (fn_check_payment_script('mcpe.php', $order_id)) { fn_finish_payment($order_id, $pp_response); } } } else { $test = $processor_data['processor_params']['mode']; $_order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id; $submit_url = 'https://secure.metacharge.com/mcpe/purser'; $post_data = array('intTestMode' => $test, 'intInstID' => $processor_data['processor_params']['merchant_id'], 'strCartID' => $_order_id, 'fltAmount' => $order_info['total'], 'strCurrency' => $processor_data['processor_params']['currency'], 'strDesc' => "Payment for Order {$order_id}"); fn_create_payment_form($submit_url, $post_data, 'metacharge.com server'); } exit;
$pp_response['order_status'] = 'P'; $pp_response['reason_text'] = $_REQUEST['msg']; $pp_response['transaction_id'] = $_REQUEST['TxnGUID']; $pp_response['card_number'] = $_REQUEST['mPAN']; $pp_response['card'] = $_REQUEST['type']; $pp_response['cardholder_name'] = $_REQUEST['name']; $pp_response['expiry_month'] = substr($_REQUEST['exp'], 0, 2); $pp_response['expiry_year'] = substr($_REQUEST['exp'], -2); } elseif (!empty($_REQUEST['error'])) { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = !empty($_REQUEST['msg']) ? $_REQUEST['msg'] : __('error'); } else { $pp_response['order_status'] = 'N'; $pp_response['reason_text'] = __('transaction_cancelled'); } if (fn_check_payment_script('cresecure.php', $order_id)) { fn_finish_payment($order_id, $pp_response); fn_order_placement_routines('route', $order_id); } } } else { if ($processor_data['processor_params']['test'] == 'live') { $post_address = "https://safe.cresecure.net/securepayments/a1/cc_collection.php"; } else { $post_address = "https://sandbox-cresecure.net/securepayments/a1/cc_collection.php"; } $post_data = array('CRESecureID' => $processor_data['processor_params']['cresecureid'], 'total_amt' => sprintf('%.2f', $order_info['total']), 'return_url' => fn_url("payment_notification.return?payment=cresecure&order_id={$order_id}", AREA, 'https'), 'content_template_url' => fn_payment_url('https', "cresecure.php?order_id={$order_id}&display_full_path=Y"), 'b_country' => db_get_field('SELECT a.code_A3 FROM ?:countries as a WHERE a.code = ?s', $order_info['b_country']), 's_country' => db_get_field('SELECT a.code_A3 FROM ?:countries as a WHERE a.code = ?s', $order_info['s_country']), 'customer_address' => $order_info['b_address'] . (!empty($order_info['b_address_2']) ? ' ' . $order_info['b_address_2'] : ''), 'delivery_address' => $order_info['s_address'] . (!empty($order_info['s_address_2']) ? ' ' . $order_info['s_address_2'] : ''), 'customer_phone' => !empty($order_info['b_phone']) ? $order_info['b_phone'] : '', 'delivery_phone' => !empty($order_info['s_phone']) ? $order_info['s_phone'] : '', 'allowed_types' => !empty($processor_data['processor_params']['allowed_types']) ? join('|', $processor_data['processor_params']['allowed_types']) : 'Visa|MasterCard', 'sess_id' => Tygh::$app['session']->getID(), 'sess_name' => Tygh::$app['session']->getName(), 'order_id' => $order_info['order_id'], 'currency' => $processor_data['processor_params']['currency'], 'CRESecureAPIToken' => $processor_data['processor_params']['cresecureapitoken'], 'customer_id' => $order_info['user_id'], 'customer_company' => $order_info['company'], 'customer_firstname' => $order_info['b_firstname'], 'customer_lastname' => $order_info['b_lastname'], 'customer_email' => $order_info['email'], 'customer_city' => $order_info['b_city'], 'customer_state' => $order_info['b_state'], 'customer_postal_code' => $order_info['b_zipcode'], 'customer_country' => $order_info['b_country'], 'delivery_firstname' => $order_info['s_firstname'], 'delivery_lastname' => $order_info['s_lastname'], 'delivery_city' => $order_info['s_city'], 'delivery_state' => $order_info['s_state'], 'delivery_postal_code' => $order_info['s_zipcode'], 'ip_address' => $_SERVER['REMOTE_ADDR']); fn_create_payment_form($post_address, $post_data, 'CRE secure', false); } exit; }
$status = $_REQUEST['Status']; $amount = $_REQUEST['Amount']; $crypt = $_REQUEST['Crypt']; // need to verify the integrity of the parameters to ensure they are not spoofed $cryptcheck = md5($status . $transid . $amount . $processor_data['processor_params']['password']); if ($status == 'Success' && $crypt == $cryptcheck) { $pp_response['order_status'] = $processor_data['processor_params']['transaction_type'] == 'PAYMENT' ? 'P' : 'O'; $pp_response['reason_text'] = 'Payment Approved'; $pp_response['transaction_id'] = $transid; } else { if ($status == 'Fail') { $pp_response['order_status'] = 'D'; $pp_response['reason_text'] = 'Status: Declined'; } elseif ($crypt != $cryptcheck) { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = "Status: Password Check Failed {$crypt} {$cryptcheck} "; } else { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = 'Status: Problem with confirming payment'; } } fn_finish_payment($_REQUEST['order_id'], $pp_response, false); fn_order_placement_routines('route', $_REQUEST['order_id']); } else { $post_address = $processor_data['processor_params']['testmode'] != "N" ? "https://testsecure.totalwebsecure.com/paypage/clear.asp" : "https://secure.totalwebsecure.com/paypage/clear.asp"; $failed_url = fn_url("payment_notification.notify?payment=totalwebpp&order_id={$order_id}", AREA, 'current'); $success_url = fn_url("payment_notification.notify?payment=totalwebpp&order_id={$order_id}", AREA, 'current'); $post_data = array('CustomerID' => $processor_data['processor_params']['vendor'], 'Notes' => $processor_data['processor_params']['order_prefix'] . $order_id, 'TransactionAmount' => $order_info['total'], 'Amount' => $order_info['total'], 'TransactionCurrency' => $processor_data['processor_params']['currency'], 'redirectorfailed' => $failed_url, 'PayPageType' => '4', 'redirectorsuccess' => $success_url, 'CustomerEmail' => $order_info['email']); fn_create_payment_form($post_address, $post_data, 'Total Web Solutions Pay Page'); } exit;
$pp_response['order_status'] = $_REQUEST['transStatus'] == 'Y' && (!empty($processor_data['processor_params']['callback_password']) ? !empty($_REQUEST['callbackPW']) && $_REQUEST['callbackPW'] == $processor_data['processor_params']['callback_password'] : true) ? 'P' : 'F'; if ($_REQUEST['transStatus'] == 'Y') { $pp_response['reason_text'] = $_REQUEST['rawAuthMessage']; $pp_response['transaction_id'] = $_REQUEST['transId']; $pp_response['descr_avs'] = 'CVV (Security Code): ' . $avs_res[substr($_REQUEST['AVS'], 0, 1)] . '; Postcode: ' . $avs_res[substr($_REQUEST['AVS'], 1, 1)] . '; Address: ' . $avs_res[substr($_REQUEST['AVS'], 2, 1)] . '; Country: ' . $avs_res[substr($_REQUEST['AVS'], 3)]; } if (!empty($_REQUEST['testMode'])) { $pp_response['reason_text'] .= '; This a TEST Transaction'; } $area = db_get_field("SELECT data FROM ?:order_data WHERE order_id = ?i AND type = 'E'", $order_id); $override = $area == 'A' ? true : false; fn_finish_payment($order_id, $pp_response, false); echo "<head><meta http-equiv='refresh' content='0; url=" . fn_url("payment_notification.notify?payment=worldpay&order_id={$order_id}", $area, 'current', CART_LANGUAGE, $override) . "'></head><body><wpdisplay item=banner></body>"; exit; } else { if (!defined('BOOTSTRAP')) { die('Access denied'); } $_order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id; $s_id = Tygh::$app['session']->getID(); $sess_name = Tygh::$app['session']->getName(); $card_holder = $processor_data['processor_params']['test'] == $mode_test_declined ? $card_holder_for_declined_test : $order_info['b_firstname'] . ' ' . $order_info['b_lastname']; $test_mode_id = $processor_data['processor_params']['test'] == $mode_test_declined ? $mode_test : $processor_data['processor_params']['test']; $signature = md5($processor_data['processor_params']['md5_secret'] . ':' . $processor_data['processor_params']['account_id'] . ':' . $order_info['total'] . ':' . $processor_data['processor_params']['currency'] . ':' . $_order_id); $data = array('signatureFields' => 'instId:amount:currency:cartId', 'signature' => $signature, 'instId' => $processor_data['processor_params']['account_id'], 'cartId' => $_order_id, 'amount' => $order_info['total'], 'currency' => $processor_data['processor_params']['currency'], 'testMode' => $test_mode_id, 'authMode' => $processor_data['processor_params']['authmode'], 'name' => $card_holder, 'tel' => $order_info['phone'], 'email' => $order_info['email'], 'address' => $order_info['b_address'] . ' ' . $order_info['b_city'] . ' ' . $order_info['b_state'] . ' ' . $order_info['b_country'], 'postcode' => $order_info['b_zipcode'], 'country' => $order_info['b_country'], "MC_{$sess_name}" => $s_id); $order_data = array('order_id' => $order_id, 'type' => 'E', 'data' => AREA); db_query("REPLACE INTO ?:order_data ?e", $order_data); $submit_url = $processor_data['processor_params']['test'] == $mode_test_declined || $processor_data['processor_params']['test'] == $mode_test ? 'https://secure-test.worldpay.com/wcc/purchase' : 'https://secure.worldpay.com/wcc/purchase'; fn_create_payment_form($submit_url, $data, 'World Pay server', false); exit; }
} elseif ($response['orderStatus'] == 2) { if ($response['amount'] == $order_info['total'] * 100) { $pp_response = array('order_status' => 'P', 'card_number' => $response['cardAuthInfo']['pan'], 'cardholder_name' => $response['cardAuthInfo']['cardholderName'], 'expiry_month' => substr($response['cardAuthInfo']['expiration'], 0, 4), 'expiry_year' => substr($response['cardAuthInfo']['expiration'], 0, -2), 'bank' => $response['bankInfo']['bankName'], 'ip_address' => $response['ip']); } else { $pp_response['reason_text'] = __("addons.rus_sberbank.wrong_amount"); } } else { $pp_response = array('order_status' => 'F', 'reason_text' => $response['actionCodeDescription'], 'ip_address' => $response['ip']); } } fn_finish_payment($order_id, $pp_response); fn_order_placement_routines('route', $order_id, false); } exit; } else { $sberbank = new Sberbank($processor_data); $response = $sberbank->register($order_info); if (!empty($processor_data['processor_params']['logging']) && $processor_data['processor_params']['logging'] == 'Y') { Sberbank::writeLog($response, 'sberbank.log'); } if (!$sberbank->isError()) { $pp_response = array('transaction_id' => $response['orderId']); fn_update_order_payment_info($order_id, $pp_response); fn_create_payment_form($response['formUrl'], array(), 'SberBank Online', true, 'GET'); } else { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = $sberbank->getErrorText(); fn_finish_payment($order_id, $pp_response); fn_order_placement_routines('route', $order_id, false); } }
$post_data_values = array('mid', 'orderid', 'status', 'orderAmount', 'currency', 'paymentTotal', 'riskScore', 'payMethod', 'txId', 'paymentRef'); foreach ($post_data_values as $post_data_value) { if (isset($_REQUEST[$post_data_value])) { $post_data[] = $_REQUEST[$post_data_value]; } } $digest = base64_encode(sha1(implode('', $post_data) . $processor_data['processor_params']['shared_secret'], true)); if ($_REQUEST['status'] == 'CAPTURED') { $pp_response['order_status'] = 'P'; $pp_response['reason_text'] = __('transaction_approved'); $pp_response['transaction_id'] = $_REQUEST['paymentRef']; } } if (fn_check_payment_script('alpha_bank.php', $order_id)) { fn_finish_payment($order_id, $pp_response); fn_order_placement_routines('route', $order_id); } } else { if ($processor_data['processor_params']['mode'] == 'test') { $payment_url = 'https://alpha.test.modirum.com/vpos/shophandlermpi'; } else { $payment_url = 'https://www.alphaecommerce.gr/vpos/shophandlermpi'; } $amount = fn_format_price($order_info['total'], $processor_data['processor_params']['currency']); $confirm_url = fn_url("payment_notification.success?payment=alpha_bank&order_id={$order_id}", AREA, 'current'); $cancel_url = fn_url("payment_notification.fail?payment=alpha_bank&order_id={$order_id}", AREA, 'current'); $post_data = array('mid' => $processor_data['processor_params']['merchant_id'], 'lang' => $processor_data['processor_params']['language'], 'orderid' => time() . $order_id, 'orderDesc' => '#' . $order_id, 'orderAmount' => $amount, 'currency' => $processor_data['processor_params']['currency'], 'payerEmail' => $order_info['email'], 'payerPhone' => $order_info['b_phone'], 'trType' => '1', 'confirmUrl' => $confirm_url, 'cancelUrl' => $cancel_url); $post_data['digest'] = base64_encode(sha1(implode('', $post_data) . $processor_data['processor_params']['shared_secret'], true)); fn_create_payment_form($payment_url, $post_data, 'Alpha Bank', false); } exit;
} else { $pp_response["order_status"] = 'F'; $pp_response["reason_text"] = "Response code: "; if (!empty($processor_error[$_REQUEST['erreur']])) { $pp_response["reason_text"] .= $processor_error[$_REQUEST['erreur']]; } elseif (strstr($_REQUEST['erreur'], '001') == true) { $pp_response["reason_text"] .= $processor_error["001xx"]; } else { $pp_response["reason_text"] .= $_REQUEST['erreur']; } } $pp_response['transaction_id'] = $_REQUEST['transac']; if (fn_check_payment_script('paybox.php', $order_id)) { fn_finish_payment($order_id, $pp_response); } exit; } } else { $paybox_script = fn_payment_url('http', 'paybox_files/modulev2.cgi'); $pbx_devise = $processor_data['processor_params']['currency']; $r_url = fn_url("payment_notification.process?payment=paybox&order_id={$order_id}&sl=" . CART_LANGUAGE, AREA, 'current'); $pbx_annule = $r_url; $pbx_effectue = $r_url; $pbx_refuse = $r_url; $pbx_retour = "montant:M;ref:R;numauto:A;transac:T;erreur:E;maref:R;"; $pbx_total = $order_info['total'] * 100; $pbx_cmd = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id; $post_data = array('PBX_MODE' => '1', 'PBX_SITE' => $processor_data['processor_params']['site_num'], 'PBX_RANG' => $processor_data['processor_params']['rank_num'], 'PBX_IDENTIFIANT' => $processor_data['processor_params']['identifier'], 'PBX_TOTAL' => $pbx_total, 'PBX_DEVISE' => $pbx_devise, 'PBX_CMD' => $pbx_cmd, 'PBX_PORTEUR' => $order_info['email'], 'PBX_RETOUR' => $pbx_retour, 'PBX_LANGUE' => $processor_data['processor_params']['language'], 'PBX_EFFECTUE' => $pbx_effectue, 'PBX_REFUSE' => $pbx_refuse, 'PBX_ANNULE' => $pbx_annule, 'PBX_BOUTPI' => 'nul', 'PBX_RUF1' => 'POST', 'PBX_TXT' => '<b>Proceeding to Payment Page ...</b>'); fn_create_payment_form($paybox_script, $post_data, 'PayBox'); exit; }
function fn_paypal_payment_form($processor_data, $token) { if ($processor_data['processor_params']['mode'] == 'live') { $host = 'https://www.paypal.com'; } else { $host = 'https://www.sandbox.paypal.com'; } $post_data = array('cmd' => '_express-checkout', 'token' => $token); $submit_url = "{$host}/webscr"; fn_create_payment_form($submit_url, $post_data, 'Paypal Express'); }
} $post_data['ordline0-1'] = __('product_id', '', $lang_code); $post_data['ordline0-2'] = __('sku', '', $lang_code); $post_data['ordline0-3'] = __('product_name', '', $lang_code); $post_data['ordline0-4'] = __('amount', '', $lang_code); $post_data['ordline0-5'] = __('price', '', $lang_code); $i = 1; foreach ($order_info['products'] as $k => $item) { $post_data['ordline' . $i . '-1'] = $item['product_id']; $post_data['ordline' . $i . '-2'] = $item['product_code']; $post_data['ordline' . $i . '-3'] = $item['product']; $post_data['ordline' . $i . '-4'] = $item['amount']; $post_data['ordline' . $i . '-5'] = $item['price']; $i++; } if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') == 'subtotal') { foreach ($order_info['taxes'] as $tax_id => $tax) { if ($tax['price_includes_tax'] == 'N') { continue; } $post_data['ordline' . $i . '-1'] = $tax_id; $post_data['ordline' . $i . '-2'] = $tax['regnumber']; $post_data['ordline' . $i . '-3'] = $tax['description']; $post_data['ordline' . $i . '-4'] = 1; $post_data['ordline' . $i . '-5'] = $tax['tax_subtotal']; $i++; } } fn_create_payment_form($post_address, $post_data, 'Dibs', false); } exit;
if ($_REQUEST['order_status'] == FondyCls::ORDER_APPROVED) { $pp_response['order_status'] = 'P'; $pp_response['reason_text'] = __('transaction_approved'); $pp_response['transaction_id'] = $_REQUEST['payment_id']; if (fn_check_payment_script('fondy.php', $order_id)) { fn_finish_payment($order_id, $pp_response); fn_order_placement_routines('route', $order_id); } } } } elseif ($mode == 'sucsses' && !empty($_REQUEST['order_id'])) { if ($response == true && $order_info['status'] == 'N') { if ($_REQUEST['order_status'] == FondyCls::ORDER_APPROVED) { $pp_response['order_status'] = 'P'; $pp_response['reason_text'] = __('transaction_approved'); $pp_response['transaction_id'] = $_REQUEST['payment_id']; fn_finish_payment($order_id, $pp_response); } } } exit; } else { $payment_url = FondyCls::URL; $amount = fn_format_price($order_info['total'], $processor_data['processor_params']['currency']); $confirm_url = fn_url("payment_notification.sucsses?payment=fondy&order_id={$order_id}", AREA, 'current'); $response_url = fn_url("payment_notification.response?payment=fondy&order_id={$order_id}", AREA, 'current'); $post_data = array('merchant_id' => $processor_data['processor_params']['fondy_merchantid'], 'lang' => $processor_data['processor_params']['fondy_lang'], 'order_id' => time() . $order_id, 'order_desc' => '#' . $order_id, 'amount' => round($amount * 100), 'currency' => $processor_data['processor_params']['currency'], 'server_callback_url' => $confirm_url, 'response_url' => $response_url); $post_data['signature'] = FondyCls::getSignature($post_data, $processor_data['processor_params']['fondy_merchnatSecretKey']); fn_create_payment_form($payment_url, $post_data, 'Fondy', false); exit; }
$__status = db_get_field("SELECT status FROM ?:orders WHERE order_id = ?i", $order_id); $pp_response = array(); $pp_response['order_status'] = $__status; $pp_response['reason_text'] = __('order_id') . '-' . $order_id; if (fn_check_payment_script('proxypay3.php', $order_id)) { fn_finish_payment($order_id, $pp_response, false); } fn_order_placement_routines('route', $order_id); } elseif ($action == 'nok') { if (empty($order_id)) { fn_set_notification('E', __('error'), __('connection_error')); fn_order_placement_routines('checkout_redirect'); } else { $pp_response = array('order_status' => 'D', 'reason_text' => __('payments.proxypay3.declined_reason_text')); fn_finish_payment($order_id, $pp_response, false); fn_order_placement_routines('route', $order_id); } } } } else { $lang = CART_LANGUAGE == 'el' ? 'GR' : 'EN'; if (in_array($processor_data['processor_params']['currency'], $totals_100)) { $total_cost = $order_info['total']; } else { $total_cost = $order_info['total'] * 100; } $order_id = $order_id . '_' . fn_date_format(time(), '%H:%M:%S'); $post_data = array('APACScommand' => 'NewPayment', 'merchantID' => $processor_data['processor_params']['merchantid'], 'amount' => $total_cost, 'merchantRef' => $order_id, 'merchantDesc' => $processor_data['processor_params']['details'], 'currency' => $processor_data['processor_params']['currency'], 'lang' => $lang, 'CustomerEmail' => $order_info['email']); fn_create_payment_form('https://' . $processor_data['processor_params']['url'], $post_data, 'Eurobank'); } exit;
$post_data['itemQuantity' . $counter] = 1; $post_data['itemPrice' . $counter] = $amount; $counter++; } } // Taxes if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') != 'unit_price') { $msg = __('tax'); foreach ($order_info['taxes'] as $tax_id => $tax_data) { if ($tax_data['price_includes_tax'] == 'N') { $amount = fn_format_price($tax_data['tax_subtotal']) * 100; $post_data['itemNumber' . $counter] = $tax_id; $post_data['itemDescription' . $counter] = $msg; $post_data['itemQuantity' . $counter] = 1; $post_data['itemPrice' . $counter] = $amount; $counter++; } } } // Shipping $shipping = $order_info['shipping_cost']; if ($shipping > 0) { $ship = $order_info['shipping_cost'] * 100; $post_data['itemNumber' . $counter] = 'SH'; $post_data['itemDescription' . $counter] = 'Shipping'; $post_data['itemQuantity' . $counter] = 1; $post_data['itemPrice' . $counter] = $ship; } fn_create_payment_form($pp_test, $post_data, 'iDeal', false); exit; }
if (fn_allowed_for('MULTIVENDOR') && fn_take_payment_surcharge_from_vendor('')) { $take_surcharge = false; } else { $take_surcharge = true; } // Payment surcharge if ($take_surcharge && floatval($order_info['payment_surcharge'])) { $suffix = '_' . $i++; $name = __('surcharge'); $payment_surcharge_amount = fn_format_price($order_info['payment_surcharge'], $paypal_currency); $post_data["item_name{$suffix}"] = $name; $post_data["amount{$suffix}"] = $payment_surcharge_amount; $post_data["quantity{$suffix}"] = '1'; } } elseif ($paypal_total == 0) { // Move shipping price to order total to avoid blocking order with zero products price $total_description = __('total_product_cost'); $post_data['item_name_1'] = $total_description; $post_data['amount_1'] = $paypal_shipping; $post_data['quantity_1'] = '1'; $post_data['amount'] = $paypal_shipping; $post_data['handling_cart'] = 0; } else { $total_description = __('total_product_cost'); $post_data["item_name_1"] = $total_description; $post_data["amount_1"] = $paypal_total; $post_data["quantity_1"] = '1'; } fn_create_payment_form($paypal_url, $post_data, 'PayPal server', false); } exit;
$str = str_replace(array("\t", "\n", "\r"), '', $str); $response_data = Http::post("https://paycenter.piraeusbank.gr/services/tickets/issuer.asmx", $str, array('headers' => array('Content-type: text/xml; charset=utf-8', 'SOAPAction: http://piraeusbank.gr/paycenter/redirection/IssueNewTicket'))); $resultcode = true; $pp_response = array(); if (strpos($response_data, '<ResultCode') !== false) { if (preg_match('!<ResultCode[^>]*>([^>]+)</ResultCode>!', $response_data, $matches)) { $resultcode = $matches[1]; } } if ($resultcode == "0") { if (strpos($response_data, '<TranTicket') !== false) { if (preg_match('!<TranTicket[^>]*>([^>]+)</TranTicket>!', $response_data, $matches)) { $data = array('order_id' => $order_id, 'type' => 'E', 'data' => $matches[1]); db_query("REPLACE INTO ?:order_data ?e", $data); } } $post_url = 'https://paycenter.piraeusbank.gr/redirection/pay.aspx'; $post_data = array('AcquirerId' => $processor_data['processor_params']['acquirerid'], 'MerchantId' => $processor_data['processor_params']['merchantid'], 'PosId' => $processor_data['processor_params']['posid'], 'User' => $processor_data['processor_params']['username'], 'LanguageCode' => $processor_data['processor_params']['languagecode'], 'MerchantReference' => $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id, 'ParamBackLink' => ""); $_SESSION['stored_piraeus_orderid'] = $order_id; fn_create_payment_form($post_url, $post_data, 'Piraeus server'); exit; } else { $pp_response['order_status'] = 'F'; $pp_response["ResultCode"] = $resultcode; if (strpos($response_data, '<ResultDescription') !== false) { if (preg_match('!<ResultDescription[^>]*>([^>]+)</ResultDescription>!', $response_data, $matches)) { $pp_response["reason_text"] = $matches[1]; } } } }
*/ use Tygh\Registry; defined('BOOTSTRAP') or die('Access denied'); if (!defined('PAYMENT_NOTIFICATION')) { $currency_settings = Registry::get('currencies.' . $processor_data['processor_params']['currency']); if (empty($currency_settings)) { $currency_settings = Registry::get('currencies.' . CART_PRIMARY_CURRENCY); } $timestamp = date('Ymdhis'); $billing_zipcode = preg_replace("/[^0-9]/", '', $order_info['b_zipcode']); $billing_address = preg_replace("/[^0-9]/", '', $order_info['b_address']); $shipping_zipcode = preg_replace("/[^0-9]/", '', $order_info['s_zipcode']); $shipping_address = preg_replace("/[^0-9]/", '', $order_info['s_address']); $post_data = array('ORDER_ID' => $order_id . $timestamp, 'MERCHANT_ID' => $processor_data['processor_params']['merchant_id'], 'ACCOUNT' => $processor_data['processor_params']['account'], 'CURRENCY' => $currency_settings['currency_code'], 'AMOUNT' => fn_format_price($order_info['total'] / $currency_settings['coefficient'], $currency_settings['currency_code']) * 100, 'TIMESTAMP' => $timestamp, 'AUTO_SETTLE_FLAG' => (int) ($processor_data['processor_params']['settlement'] == 'auto'), 'RETURN_TSS' => '1', 'MERCHANT_RESPONSE_URL' => fn_url("payment_notification.process&payment=realex_redirect&order_id={$order_id}", AREA, 'current'), 'SHIPPING_CO' => $order_info['s_country'], 'SHIPPING_CODE' => substr($shipping_zipcode, 0, 5) . '|' . substr($shipping_address, 0, 5), 'BILLING_CO' => $order_info['b_country'], 'BILLING_CODE' => substr($billing_zipcode, 0, 5) . '|' . substr($billing_address, 0, 5)); $post_data['SHA1HASH'] = sha1(strtolower(sha1($post_data['TIMESTAMP'] . '.' . $post_data['MERCHANT_ID'] . '.' . $post_data['ORDER_ID'] . '.' . $post_data['AMOUNT'] . '.' . $post_data['CURRENCY'])) . '.' . $processor_data['processor_params']['secret_word']); fn_create_payment_form($processor_data['processor_params']['mode'] == 'test' ? "https://hpp.sandbox.realexpayments.com/pay" : "https://hpp.realexpayments.com/pay", $post_data, 'Realex Payments', false); } else { if ($mode == 'process') { if (fn_check_payment_script('realex_redirect.php', $_REQUEST['order_id'], $processor_data)) { $avs = array('M' => __('payments.realex.avs.matched'), 'N' => __('payments.realex.avs.not_matched'), 'I' => __('payments.realex.avs.problem_with_check'), 'U' => __('payments.realex.avs.unable_to_check'), 'P' => __('payments.realex.avs.partial_match')); $pp_response = array('order_status' => 'F', 'reason_text' => 'Your transaction was unsuccessful. There was a problem with your order, please return to the checkout and try again.', 'payments.realex.transaction_order_id' => isset($_REQUEST['ORDER_ID']) ? $_REQUEST['ORDER_ID'] : 'N/A', 'payments.realex.transaction_pasref' => isset($_REQUEST['PASREF']) ? $_REQUEST['PASREF'] : 'N/A', 'payments.realex.result_code' => isset($_REQUEST['RESULT']) ? $_REQUEST['RESULT'] : 'N/A', 'payments.realex.result_message' => isset($_REQUEST['MESSAGE']) ? $_REQUEST['MESSAGE'] : 'N/A', '3d_secure' => isset($_REQUEST['XID']) || isset($_REQUEST['CAVV']) || isset($_REQUEST['ECI']) ? __('enabled') : __('disabled'), 'payments.realex.xid' => isset($_REQUEST['XID']) ? $_REQUEST['XID'] : 'N/A', 'payments.realex.cavv' => isset($_REQUEST['CAVV']) ? $_REQUEST['CAVV'] : 'N/A', 'payments.realex.eci' => isset($_REQUEST['ECI']) ? $_REQUEST['ECI'] : 'N/A', 'payments.realex.tss_result' => isset($_REQUEST['TSS']) ? $_REQUEST['TSS'] : 'N/A', 'payments.realex.avs_address' => isset($_REQUEST['AVSADDRESSRESULT'], $avs[$_REQUEST['AVSADDRESSRESULT']]) ? $avs[$_REQUEST['AVSADDRESSRESULT']] : 'N/A', 'payments.realex.avs_postcode' => isset($_REQUEST['AVSPOSTCODERESULT'], $avs[$_REQUEST['AVSPOSTCODERESULT']]) ? $avs[$_REQUEST['AVSPOSTCODERESULT']] : 'N/A'); $order_info = fn_get_order_info($_REQUEST['order_id']); if (empty($processor_data)) { $processor_data = fn_get_processor_data($order_info['payment_id']); } $realex_statuses = $processor_data['processor_params']['statuses']; $realex_response_code = $_REQUEST['RESULT']; if ($realex_response_code == '00') { // Successful – the transaction has processed and you may proceed with the sale. $pp_response['order_status'] = $realex_statuses['successful']; $pp_response['reason_text'] = __('successful');
$post['ClientIPAddress'] = $_SERVER['REMOTE_ADDR']; Registry::set('log_cut_data', array('CardNumber', 'ExpiryDate', 'StartDate', 'CV2')); $result = Http::post($post_address, $post); } $rarr = explode("\r\n", $result); $response = array(); foreach ($rarr as $v) { if (preg_match('/([^=]+?)=(.+)/', $v, $m)) { $response[$m[1]] = trim($m[2]); } } if ($response['Status'] == '3DAUTH') { $payment_mode = $processor_data['processor_params']['testmode']; $term_url = fn_payment_url('https', "sagepay_direct.php?order_id=" . $order_info['order_id'] . "&payment_mode={$payment_mode}"); $post_data = array('PaReq' => $response['PAReq'], 'TermUrl' => $term_url, 'MD' => $response['MD']); fn_create_payment_form($response['ACSURL'], $post_data, '3D Secure'); exit; } elseif ($response['Status'] == 'OK' || $response['Status'] == 'AUTHENTICATED' || $response['Status'] == 'REGISTERED') { $pp_response['order_status'] = 'P'; if (!empty($response['TxAuthNo'])) { $pp_response['reason_text'] = 'AuthNo: ' . @$response['TxAuthNo']; } if (!empty($response['SecurityKey'])) { $pp_response['reason_text'] = 'SecurityKey: ' . $response['SecurityKey']; } else { $pp_response['reason_text'] = ''; } } else { $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = ''; }
if ($order_status == STATUS_INCOMPLETED_ORDER) { $pp_response = array(); $pp_response['order_status'] = 'F'; $pp_response['reason_text'] = __('merchant_response_was_not_received'); $pp_response['transaction_id'] = ''; fn_finish_payment($order_id, $pp_response); } fn_order_placement_routines('route', $order_id, false); } elseif ($mode == 'cancel') { $pp_response['order_status'] = 'N'; $pp_response['reason_text'] = __('text_transaction_cancelled'); fn_finish_payment($order_id, $pp_response, false); fn_order_placement_routines('route', $order_id); } } else { $total = fn_rus_pay_format_price($order_info['total'], $processor_data['processor_params']['currency']); if ($processor_data['processor_params']['commission'] == 'admin') { $url = 'https://auth.robokassa.ru/Merchant/WebService/Service.asmx/CalcOutSumm'; $data = array('MerchantLogin' => $processor_data['processor_params']['merchantid'], 'IncCurrLabel' => $processor_data['processor_params']['payment_method'], 'IncSum' => $total); $total_xml = Http::post($url, $data); $xml = @simplexml_load_string($total_xml); if (isset($xml->Result->Code) && $xml->Result->Code == 0) { $total = $xml->OutSum; } } $crc = md5($processor_data['processor_params']['merchantid'] . ':' . $total . ':' . $order_id . ':' . $processor_data['processor_params']['password1']); $url = $processor_data['processor_params']['mode'] == 'live' ? 'https://merchant.roboxchange.com/Index.aspx' : 'http://test.robokassa.ru/Index.aspx'; $post_data = array('MrchLogin' => $processor_data['processor_params']['merchantid'], 'OutSum' => $total, 'InvId' => $order_id, 'Desc' => $processor_data['processor_params']['details'], 'SignatureValue' => $crc, 'Culture' => CART_LANGUAGE, 'IncCurrLabel' => $processor_data['processor_params']['payment_method']); fn_create_payment_form($url, $post_data, 'Robokassa server'); } exit;
$result = fn_paypal_set_bml_checkout($payment_id, 0, array(), Tygh::$app['session']['cart']); $useraction = 'continue'; } else { $result = fn_paypal_set_bml_checkout($payment_id, $order_id, $order_info); $useraction = "commit"; } if (fn_paypal_ack_success($result) && !empty($result['TOKEN'])) { $processor_data = fn_get_payment_method_data($payment_id); if ($processor_data['processor_params']['mode'] == 'live') { $host = 'https://www.paypal.com'; } else { $host = 'https://www.sandbox.paypal.com'; } $post_data = array('cmd' => '_express-checkout', 'token' => $result['TOKEN'], 'useraction' => $useraction); $submit_url = "{$host}/webscr"; fn_create_payment_form($submit_url, $post_data, 'Paypal Express'); } else { fn_paypal_get_error($result); if ($mode == 'express') { fn_order_placement_routines('checkout.cart'); } else { fn_order_placement_routines('checkout_redirect'); } } } function fn_paypal_set_bml_checkout($payment_id, $order_id = 0, $order_info = array(), $cart = array(), $area = AREA) { $processor_data = fn_get_payment_method_data($payment_id); if (!empty($order_id)) { $return_url = fn_url("payment_notification.notify?payment=paypal_bml&order_id={$order_id}", $area, 'current'); $cancel_url = fn_url("payment_notification.cancel?payment=paypal_bml&order_id={$order_id}", $area, 'current');
/** * Begins 3DSecure transaction. * This method is called right after checkout. * * @return array Payment processor response */ protected function begin3DSecureTransaction() { // Send 3DSecure verify-enrolled XML request to Realex with card details // Realex check the Visa or Mastercard Directory to see if the card is enrolled in the 3DSecure program $verifyenrolled_response = simplexml_load_string($this->send3DSecureVerifyEnrolledRequest()); $this->response['payments.realex.3d_secure_message'] = "3DS Verifyenrolled request: " . (string) $verifyenrolled_response->message; // Yes - card is enrolled in the 3DSecure program. // Realex send the URL of the cardholder’s bank ACS (Access Control Server - this is the webpage that // the cardholder uses to enter their password). Also included is the PAReq (this is needed by the ACS). if ((string) $verifyenrolled_response->result == '00' && (string) $verifyenrolled_response->enrolled == 'Y') { // We redirect user to ACS $this->redirected_to_acs = true; fn_create_payment_form((string) $verifyenrolled_response->url, array('PaReq' => (string) $verifyenrolled_response->pareq, 'TermUrl' => fn_url("payment_notification.process&payment=realex_remote&order_id={$this->order_info['order_id']}×tamp={$this->request_data['TIMESTAMP']}", AREA, 'current')), 'Realex Payments', false); } elseif ((string) $verifyenrolled_response->result == '110' && (string) $verifyenrolled_response->enrolled == 'N') { $this->authorizeTransaction(self::TRANSACTION_MERCHANT_3DSECURE); } elseif ((string) $verifyenrolled_response->result == '503') { $this->performNon3DSecureTransaction(); } elseif ((string) $verifyenrolled_response->enrolled == 'U' || (int) $verifyenrolled_response->result >= 500 && (int) $verifyenrolled_response->result < 600 || (string) $verifyenrolled_response->result == '220') { if (!$this->getIsLiabilityShiftRequired()) { $this->authorizeTransaction(self::TRANSACTION_NON_3DSECURE); } } return $this->response; }
$order_id = intval($_REQUEST['ref']); fn_order_placement_routines('route', $order_id, false); } elseif ($mode == 'cancel') { $params = array(); parse_str(base64_decode($_REQUEST['divers']), $params); $pp_response['order_status'] = 'N'; $pp_response['reason_text'] = __('text_transaction_cancelled'); fn_finish_payment($params['order_id'], $pp_response, false); fn_order_placement_routines('route', $params['order_id'], false); } } else { if (!defined('BOOTSTRAP')) { die('Access denied'); } // Params $url = array('psc' => 'https://billing.paysite-cash.biz', 'ep' => 'https://secure.easy-pay.net'); $site_id = $processor_data['processor_params']['site_id']; $currency = $processor_data['processor_params']['currency']; $processor = $processor_data['processor_params']['processor']; $test = $processor_data['processor_params']['mode']; $debug = $processor_data['processor_params']['debug']; $nocurrencies = $processor_data['processor_params']['nocurrencies']; $order_id = $order_info['order_id']; $email = $order_info['email']; $total_amount = $order_info['total']; $lang = $order_info['lang_code']; $divers = base64_encode('key=' . md5($total_amount . Registry::get('config.crypt_key') . $order_id) . '&order_id=' . $order_id); $post_data = array('site' => $site_id, 'ref' => $order_id, 'montant' => $total_amount, 'devise' => $currency, 'divers' => $divers, 'email' => $email, 'test' => $test, 'debug' => $debug, 'nocurrencies' => $nocurrencies, 'lang' => $lang); fn_create_payment_form($url[$processor], $post_data); exit; }
die('Access denied'); } if (defined('PAYMENT_NOTIFICATION')) { if ($mode == 'process') { $pp_response["order_status"] = $_REQUEST['Result'] == "1" ? 'P' : 'F'; if ($_REQUEST['Result'] == 2) { $pp_response["reason_text"] = "Error"; } elseif ($_REQUEST['Result'] == 3) { $pp_response["order_status"] = 'I'; $pp_response["reason_text"] = "Cancelled"; } if (isset($_REQUEST['ErrorMessage'])) { $pp_response["reason_text"] .= ": " . $_REQUEST['ErrorMessage']; } if (isset($_REQUEST['DeltaPayId'])) { $pp_response["transaction_id"] = $_REQUEST['DeltaPayId']; } $order_id = strpos($_REQUEST['Param1'], '_') ? substr($_REQUEST['Param1'], 0, strpos($_REQUEST['Param1'], '_')) : $_REQUEST['Param1']; if (fn_check_payment_script('deltapay.php', $order_id)) { fn_finish_payment($order_id, $pp_response, false); fn_order_placement_routines('route', $order_id); } } } else { $amount = str_replace('.', ',', $order_info["total"]); $_order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id; $submit_url = 'https://www.deltapay.gr/entry.asp'; $post_data = array('merchantCode' => $processor_data['processor_params']['merchant_id'], 'param1' => $_order_id, 'charge' => $amount, 'currencycode' => $processor_data['processor_params']['currency'], 'transactiontype' => '1', 'installments' => '0', 'cardholderemail' => $order_info['email']); fn_create_payment_form($submit_url, $post_data, 'DeltaPay server'); exit; }
$post_data[$item_name] = "1,{$item_price}"; } } // Gift Certificates if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $k => $v) { $v['gift_cert_code'] = htmlspecialchars($v['gift_cert_code']); $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : fn_format_price($v['amount']); $post_data[$v['gift_cert_code']] = "1,{$v['amount']}"; } } // Payment surcharge if (floatval($order_info['payment_surcharge'])) { $name = __('surcharge'); $payment_surcharge_amount = fn_format_price($order_info['payment_surcharge']); $post_data[$name] = "1,{$payment_surcharge_amount}"; } // Shipping $_shipping_cost = fn_order_shipping_cost($order_info); if (floatval($_shipping_cost)) { $name = __('shipping_cost'); $payment_shipping_cost = fn_format_price($_shipping_cost); $post_data[$name] = "1,{$payment_shipping_cost}"; } } else { $total_description = __('total_product_cost'); $post_data[$total_description] = "1,{$order_info['total']}"; } fn_create_payment_form($submit_url, $post_data, 'DirectOne server', false); exit; }
$payment_type = 'PC'; } else { $payment_type = $payment_info['yandex_payment_type']; } $phone = ''; if (!empty($order_info['phone'])) { $phone = $order_info['phone']; } elseif (!empty($order_info['b_phone'])) { $phone = $order_info['b_phone']; } elseif (!empty($order_info['s_phone'])) { $phone = $order_info['s_phone']; } $customer_phone = str_replace('+', '', $phone); $orderNumber = $order_info['order_id'] . '_' . substr(md5($order_info['order_id'] . TIME), 0, 3); $post_data = array('shopId' => $processor_data['processor_params']['shop_id'], 'Sum' => fn_yandex_money_get_sum($order_info, $processor_data), 'scid' => $processor_data['processor_params']['scid'], 'customerNumber' => $order_info['email'], 'orderNumber' => $orderNumber, 'shopSuccessURL' => fn_url("payment_notification.ok?payment=yandex_money&ordernumber={$orderNumber}", AREA, 'https'), 'shopFailURL' => fn_url("payment_notification.error?payment=yandex_money&ordernumber={$orderNumber}", AREA, 'https'), 'cps_email' => $order_info['email'], 'cps_phone' => $customer_phone, 'paymentAvisoURL' => fn_url("payment_notification.payment_aviso?payment=yandex_money", AREA, 'https'), 'checkURL' => fn_url("payment_notification.check_order?payment=yandex_money", AREA, 'https'), 'paymentType' => $payment_type, 'cms_name' => 'cscart'); if (!empty($processor_data['processor_params']['logging']) && $processor_data['processor_params']['logging'] == 'Y') { fn_yandex_money_log_write($post_data, 'ym_post_data.log'); } fn_create_payment_form($post_address, $post_data, 'Yandex.Money', false); } function fn_yandex_money_get_sum($order_info, $processor_data) { $price = $order_info['total']; if (CART_PRIMARY_CURRENCY != $processor_data['processor_params']['currency']) { $currencies = Registry::get('currencies'); $currency = $currencies[$processor_data['processor_params']['currency']]; $price = fn_format_rate_value($price, 'F', $currency['decimals'], '.', '', $currency['coefficient']); } return sprintf('%.2f', $price); } exit;