本文整理汇总了PHP中fn_finish_payment函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_finish_payment函数的具体用法?PHP fn_finish_payment怎么用?PHP fn_finish_payment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_finish_payment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateBill
function updateBill($param)
{
if (!is_object($param)) {
return false;
}
$order_info = fn_get_order_info($param->txn, false, true, true, true);
$temp = '';
if (!empty($order_info['payment_method']['processor_params']['passwd']) && !empty($order_info['payment_method']['processor_params']['login'])) {
$txn = fn_convert_encoding('utf-8', 'windows-1251', $param->txn);
$password = fn_convert_encoding('utf-8', 'windows-1251', $order_info['payment_method']['processor_params']['passwd']);
$crc = strtoupper(md5($txn . strtoupper(md5($password))));
if ($param->login == $order_info['payment_method']['processor_params']['login'] && $param->password == $crc) {
$pp_response = array();
$status = 'qiwi_order_status_' . $param->status;
if ($param->status == 60) {
$pp_response['order_status'] = 'P';
} elseif ($param->status >= 50 && $param->status < 60) {
$pp_response['order_status'] = 'O';
} else {
$pp_response['order_status'] = 'F';
}
$pp_response['reason_text'] = __($status);
fn_finish_payment($param->txn, $pp_response);
$temp = new Response();
$temp->updateBillResult = 0;
}
}
return $temp;
}
示例2: fn_paypal_complete_checkout
function fn_paypal_complete_checkout($token, $processor_data, $order_info)
{
$pp_response['order_status'] = 'F';
$reason_text = '';
$paypal_checkout_details = fn_paypal_get_express_checkout_details($processor_data, $token);
if (fn_paypal_ack_success($paypal_checkout_details)) {
$result = fn_paypal_do_express_checkout($processor_data, $paypal_checkout_details, $order_info);
if (fn_paypal_ack_success($result)) {
$status = $result['PAYMENTINFO_0_PAYMENTSTATUS'];
$pp_response['transaction_id'] = $result['PAYMENTINFO_0_TRANSACTIONID'];
if ($status == 'Completed' || $status == 'Processed') {
$pp_response['order_status'] = 'O';
$reason_text = 'Accepted, awaiting ipn for processing ';
} elseif ($status == 'Pending') {
$pp_response['order_status'] = 'O';
$reason_text = 'Pending ';
} else {
$reason_text = 'Declined ';
}
$reason_text = fn_paypal_process_add_fields($result, $reason_text);
if (!empty($result['L_ERRORCODE0'])) {
$reason_text .= ', ' . fn_paypal_get_error($result);
}
} else {
$reason_text = fn_paypal_get_error($result);
}
} else {
$reason_text = fn_paypal_get_error($paypal_checkout_details);
}
$pp_response['reason_text'] = $reason_text;
if (fn_check_payment_script($processor_data['processor_script'], $order_info['order_id'])) {
unset($_SESSION['pp_express_details']);
fn_finish_payment($order_info['order_id'], $pp_response);
fn_order_placement_routines('route', $order_info['order_id'], false);
}
}
示例3: fn_add_breadcrumb
}
}
fn_add_breadcrumb(__('landing_header'));
} elseif ($mode == 'process_payment') {
if (fn_allow_place_order($cart, $auth) == true) {
$order_info = $cart;
$order_info['products'] = $cart['products'];
$order_info = fn_array_merge($order_info, $cart['user_data']);
$order_info['order_id'] = $order_id = TIME . "_" . (!empty($auth['user_id']) ? $auth['user_id'] : 0);
unset($order_info['user_data']);
list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id']);
if ($is_processor_script) {
set_time_limit(300);
fn_define('IFRAME_MODE', true);
include Registry::get('config.dir.payments') . $processor_data['processor_script'];
fn_finish_payment($order_id, $pp_response, array());
fn_order_placement_routines('route', $order_id);
}
}
}
if (fn_cart_is_empty($cart) && !isset($force_redirection) && !in_array($mode, array('clear', 'delete', 'cart', 'update', 'apply_coupon', 'shipping_estimation', 'update_shipping', 'complete'))) {
fn_set_notification('W', __('cart_is_empty'), __('cannot_proccess_checkout', 'K', 'cannot_proccess_checkout'));
return array(CONTROLLER_STATUS_REDIRECT, 'checkout.cart');
}
if (!empty($profile_fields)) {
Tygh::$app['view']->assign('profile_fields', $profile_fields);
}
Tygh::$app['view']->assign('cart', $cart);
Tygh::$app['view']->assign('continue_url', empty($_SESSION['continue_url']) ? '' : $_SESSION['continue_url']);
Tygh::$app['view']->assign('mode', $mode);
Tygh::$app['view']->assign('payment_methods', $payment_methods);
示例4: __
} else {
$pp_response['order_status'] = 'F';
if ($_REQUEST['md5sig'] != $our_md5sig) {
$pp_response['reason_text'] .= __('mb_md5_hashes_not_match');
}
if (!$adjusted_order_total) {
$pp_response['reason_text'] .= __('text_unsupported_currency');
} elseif ($_REQUEST['amount'] != $adjusted_order_total) {
$pp_response['reason_text'] .= __('mb_amounts_not_match');
}
if ($_REQUEST['currency'] != $processor_data['processor_params']['currency']) {
$pp_response['reason_text'] .= __('mb_currencies_not_match');
}
}
if (fn_check_payment_script('skrill_ewallet.php', $_REQUEST['order_id'])) {
fn_finish_payment($_REQUEST['order_id'], $pp_response);
}
exit;
}
} else {
$url = 'https://www.moneybookers.com/app/payment.pl';
$suffix = AREA != 'A' && empty($order_info['repaid']) && defined('IFRAME_MODE') ? '&iframe_mode=true' : '';
$post_data = array('pay_to_email' => $processor_data['processor_params']['pay_to_email'], 'recipient_description' => $processor_data['processor_params']['recipient_description'], 'transaction_id' => $processor_data['processor_params']['order_prefix'] . (!empty($order_info['repaid']) ? $order_id . '_' . $order_info['repaid'] : $order_id), 'return_url' => fn_url("payment_notification.return?payment=skrill_ewallet&order_id={$order_id}{$suffix}", AREA, 'current'), 'return_url_text' => '', 'cancel_url' => fn_url("payment_notification.cancel?payment=skrill_ewallet&order_id={$order_id}{$suffix}", AREA, 'current'), 'status_url' => fn_url("payment_notification.status?payment=skrill_ewallet&order_id={$order_id}{$suffix}", AREA, 'current'), 'language' => $processor_data['processor_params']['language'], 'amount' => $order_info['total'], 'currency' => $processor_data['processor_params']['currency'], 'return_url_target' => '_parent', 'cancel_url_target' => '_parent', 'merchant_fields' => 'platform,mb_sess_id,inner_order_id', 'mb_sess_id' => base64_encode(Tygh::$app['session']->getID()), 'inner_order_id' => $order_id, 'platform' => '21477207');
$post_data['amount'] = fn_mb_adjust_amount($post_data['amount'], $post_data['currency']);
if (!$post_data['amount']) {
if (!empty($suffix)) {
echo __('text_unsupported_currency');
} else {
fn_set_notification('E', __('error'), __('text_unsupported_currency'));
$url = fn_url("payment_notification.unsupported_currency?payment=skrill_ewallet&order_id={$order_id}", AREA, 'current');
fn_create_payment_form($url, array());
示例5: fn_finish_payment
fn_finish_payment($order_id, $pp_response);
exit;
}
} elseif (defined('PAYMENT_NOTIFICATION')) {
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($mode == 'process') {
$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'];
示例6: array
$pp_response = array();
$order_info = fn_get_order_info($_REQUEST['brq_invoicenumber']);
$processor_data = fn_get_payment_method_data($order_info['payment_id']);
$pp_response["transaction_id"] = $_REQUEST['brq_transactions'];
$pp_response["reason_text"] = urldecode($_REQUEST['brq_statusmessage']);
$_REQUEST['brq_websitekey'] = $processor_data['processor_params']['merchant_id'];
$_signature = fn_buckaroo_calculate_signature($_REQUEST, $processor_data["processor_params"]["merchant_key"]);
if (in_array($_REQUEST['brq_statuscode'], array('190')) && $_REQUEST['brq_signature'] == $_signature) {
$pp_response['order_status'] = 'P';
} elseif (in_array($_REQUEST['brq_statuscode'], array('791', '492'))) {
$pp_response['order_status'] = 'O';
// 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)
{
示例7: preg_replace
$address->zip = preg_replace('/[^0-9]/', '', $order_info['b_zipcode']);
$address->country = $order_info['b_country'];
$validCardHolder = new HpsCardHolder();
$validCardHolder->firstName = $order_info['b_firstname'];
$validCardHolder->lastName = $order_info['b_lastname'];
$validCardHolder->address = $address;
$validCardHolder->phoneNumber = preg_replace('/[^0-9]/', '', $order_info['b_phone']);
$suToken = new HpsTokenData();
$suToken->tokenValue = $_REQUEST['securesubmit_token'];
try {
$pp_response = array('reason_text' => '', 'order_status' => 'F');
$response = $chargeService->charge($order_info['total'], 'usd', $suToken, $validCardHolder);
$pp_response['order_status'] = "P";
$pp_response['reason_text'] = 'Payment processed.';
$pp_response["transaction_id"] = $response->transactionId;
fn_finish_payment($merchant_order_id, $pp_response);
fn_order_placement_routines('route', $merchant_order_id);
} catch (HpsException $e) {
fn_set_notification('E', __('error'), "Transaction Failed: " . $e->getMessage() . " With order id: " . $_REQUEST['merchant_order_id']);
fn_order_placement_routines('checkout_redirect');
}
}
exit;
} else {
$url = fn_url("payment_notification.return?payment=heartland", AREA, 'current');
$checkout_url = "js/securesubmit.js";
$key = $processor_data['processor_params']['publickey'];
fn_set_session_data('secretkey', $processor_data['processor_params']['secretkey']);
fn_set_session_data('order_info', $order_info);
$formhtml = '<form name="securesubmit-form" id="securesubmit-form" action="' . $url . '" target="_parent" method="POST">
<input type="hidden" name="securesubmit_token" id="securesubmit_token" />
示例8: http_build_query
exit;
}
$litepaid_id = $_GET['litepaid_id'];
if (empty($order_info['payment_info']['transaction_id']) || $order_info['payment_info']['transaction_id'] != $litepaid_id) {
echo "<p>LitePaid ID is incorrect.</p>", $redirect_timeout;
exit;
}
$response = Http::get('https://www.litepaid.com/api?' . http_build_query(array('key' => trim($processor_data['processor_params']['api_key']), 'id' => $litepaid_id)));
if (!$response || !($response = @json_decode($response, true))) {
echo "<p>LitePaid API request failed. Contact support.</p>";
echo $redirect_timeout;
exit;
}
if (!empty($response['result']) && $response['result'] == 'success') {
$payment_info = array('order_status' => 'P', 'transaction_id' => $litepaid_id, 'reason_text' => isset($response['data']['error_name']) ? $response['data']['error_name'] : '');
fn_finish_payment($order_id, $payment_info, false);
fn_order_placement_routines('route', $order_id);
} else {
fn_order_placement_routines('route', $order_id);
}
} else {
$amount = $order_info['total'];
$currencies = Registry::get('currencies');
if (!empty($currencies['EUR']['coefficient'])) {
$amount /= $currencies['EUR']['coefficient'];
}
$data = array('key' => trim($processor_data['processor_params']['api_key']), 'value' => number_format($amount, 2, '.', ''), 'return_url' => fn_url("payment_notification.return?payment=litepaid&order_id={$order_id}", AREA, 'current'), 'description' => 'Order #' . $order_id, 'test' => !empty($processor_data['processor_params']['test_mode']) ? '1' : '0');
$response = Http::get('https://www.litepaid.com/api?' . http_build_query($data));
if (!$response || !($response = @json_decode($response, true)) || empty($response['result']) || $response['result'] != 'success' || empty($response['data']['invoice_token'])) {
echo "<p>LitePaid API request failed. Choose another payment method to complete your order.</p>";
if (!empty($response['data']['error_name'])) {
示例9: fn_start_payment
/**
* Order payment processing
*
* @param array $payment payment data
* @param int $order_id order ID
* @param bool $force_notification force user notification (true - notify, false - do not notify, order status properties will be skipped)
* @return bool True on success, false otherwise
*/
function fn_start_payment($order_id, $force_notification = array(), $payment_info = array())
{
$order_info = fn_get_order_info($order_id);
if (!empty($order_info['payment_info']) && !empty($payment_info)) {
$order_info['payment_info'] = $payment_info;
}
list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id']);
if ($is_processor_script) {
set_time_limit(300);
$idata = array('order_id' => $order_id, 'type' => 'S', 'data' => TIME);
db_query("REPLACE INTO ?:order_data ?e", $idata);
$mode = Registry::get('runtime.mode');
Embedded::leave();
include fn_get_processor_script_path($processor_data['processor_script']);
return fn_finish_payment($order_id, $pp_response, $force_notification);
}
return false;
}
示例10: db_get_field
if (!empty($_REQUEST['EncryptedParameters'])) {
$payment_id = db_get_field("SELECT a.payment_id FROM ?:payments as a LEFT JOIN ?:payment_processors as b ON a.processor_id = b.processor_id WHERE a.status = 'A' AND b.processor_script = 'westpac.php' LIMIT 1");
$processor_data = fn_get_payment_method_data($payment_id);
$params = fn_payway_decrypt_parameters($processor_data['params']['encryption_key'], $_REQUEST['EncryptedParameters'], $_REQUEST['Signature']);
if (!empty($params)) {
$status = db_get_field("SELECT status FROM ?:orders WHERE order_id = ?i", $params['payment_reference']);
if ($status == 'O') {
if (!empty($params['bank_reference'])) {
$pp_response["order_status"] = 'P';
$pp_response["reason_text"] = "Authorization code: " . $params['bank_reference'];
} else {
$pp_response["order_status"] = 'F';
}
$pp_response['transaction_id'] = $params['payment_number'];
if (fn_check_payment_script('westpac.php', $params['payment_reference'])) {
fn_finish_payment($params['payment_reference'], $pp_response, false);
}
}
fn_order_placement_routines($params['payment_reference']);
}
}
exit;
} else {
$merchant_id = $processor_data['params']['mode'] == 'test' ? 'TEST' : $processor_data['params']['merchant_id'];
$biller_code = $processor_data['params']['biller_code'];
echo <<<EOT
<html>
<body onLoad="javascript: document.process.submit();">
<form method="post" action="https://www.payway.com.au/MakePayment" name="process">
\t<input type="hidden" name="merchant_id" value="{$merchant_id}">
\t<input type="hidden" name="biller_code" value="{$biller_code}">
示例11: fn_start_payment
/**
* Order payment processing
*
* @param array $payment payment data
* @param int $order_id order ID
* @param bool $force_notification force user notification (true - notify, false - do not notify, order status properties will be skipped)
*/
function fn_start_payment($order_id, $force_notification = array())
{
$order_info = fn_get_order_info($order_id);
list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id'], '');
if ($is_processor_script) {
set_time_limit(300);
$idata = array('order_id' => $order_id, 'type' => 'S', 'data' => TIME);
db_query("REPLACE INTO ?:order_data ?e", $idata);
$index_script = INDEX_SCRIPT;
$mode = MODE;
include DIR_PAYMENT_FILES . $processor_data['processor_script'];
return fn_finish_payment($order_id, $pp_response, $force_notification);
}
return false;
}
示例12: kaznacheyLib
require_once $ExternalLibPath;
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'notify') {
$kaznachey = new kaznacheyLib();
$order_id = isset($_GET['OrderId']) ? $_GET['OrderId'] : false;
if ($_GET['Result'] == 'success') {
$kaznachey->success_page($order_id);
die;
}
if ($_GET['Result'] == 'deferred') {
$kaznachey->deferred_page($order_id);
die;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents('php://input');
$hrpd = json_decode($HTTP_RAW_POST_DATA);
if (isset($hrpd->MerchantInternalPaymentId)) {
if ($hrpd->ErrorCode == 0) {
$pp_response['order_status'] = 'P';
$pp_response["reason_text"] = '';
$pp_response["kaznachey"] = $pay_msg . $hrpd->MerchantInternalPaymentId . $test_msg;
$pp_response["transaction_id"] = $hrpd->MerchantInternalPaymentId;
fn_finish_payment(intval($hrpd->MerchantInternalPaymentId), $pp_response);
}
}
}
} else {
$order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id;
$kaznachey = new kaznacheyLib($processor_data);
$kaznachey->createOrder($order_id, $order_info);
exit;
}
示例13: fn_twg_start_payment
/**
* Copy of the fn_start_payment - to change MODE to place_order
*
* @param array $payment payment data
* @param int $order_id order ID
* @param bool $force_notification force user notification
* (true - notify, false - do not notify, order status properties will be skipped)
*/
function fn_twg_start_payment($order_id, $force_notification = array(), $payment_info)
{
$order_info = fn_get_order_info($order_id);
if (!empty($order_info['payment_info']) && !empty($payment_info)) {
$order_info['payment_info'] = $payment_info;
}
list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id'], '');
if ($is_processor_script) {
set_time_limit(300);
$idata = array('order_id' => $order_id, 'type' => 'S', 'data' => TIME);
db_query("REPLACE INTO ?:order_data ?e", $idata);
$index_script = Registry::get('config.admin_index');
$mode = 'place_order';
// Change mode from 'post' to 'place_order'
include Registry::get('config.dir.payments') . $processor_data['processor_script'];
return fn_finish_payment($order_id, $pp_response, $force_notification);
}
return false;
}
示例14: fn_manageState
function fn_manageState($state, $idstate, $mode, $orderId, $payNLTransactionID, $processor_data)
{
switch ($state) {
case 'PENDING':
if ($mode == 'exchange') {
echo 'TRUE| state:PENDING, orderId:' . $orderId . ', transactionId:' . $payNLTransactionID . ',idState:' . $idstate . ', service_id:' . $processor_data['processor_params']['service_id'] . ',token_api:' . $processor_data['processor_params']['token_api'] . ',statuses:' . print_r($processor_data['processor_params']['statuses'], true);
} else {
fn_order_placement_routines('route', $orderId);
}
die;
break;
case 'PAID':
$payData = fn_paynl_getInfo($payNLTransactionID, $processor_data);
$pp_response = array('order_status' => $idstate, 'naam' => $payData['paymentDetails']['identifierName'], 'rekening' => $payData['paymentDetails']['identifierPublic']);
if ($mode == 'exchange') {
echo 'TRUE| orderId=' . $orderId . ', transactionId=' . $payNLTransactionID . ',idState:' . $idstate . ', service_id:' . $processor_data['processor_params']['service_id'] . ',token_api:' . $processor_data['processor_params']['token_api'] . ',statuses:' . print_r($processor_data['processor_params']['statuses'], true);
fn_finish_payment($orderId, $pp_response, true);
fn_updatePayTransaction($payNLTransactionID, 'PAID');
die;
} else {
fn_order_placement_routines('route', $orderId);
}
break;
case 'CANCEL':
if ($mode == 'exchange') {
echo 'TRUE| CANCEL orderId=' . $orderId . ', transactionId=' . $payNLTransactionID . ',idState:' . $idstate . ', service_id:' . $processor_data['processor_params']['service_id'] . ',token_api:' . $processor_data['processor_params']['token_api'] . ',statuses:' . print_r($processor_data['processor_params']['statuses'], true);
fn_updatePayTransaction($payNLTransactionID, 'CANCEL');
die;
} else {
fn_updatePayTransaction($payNLTransactionID, 'CANCEL');
fn_change_order_status($orderId, $idstate, '', false);
fn_order_placement_routines('route', $orderId);
}
break;
case 'CHECKAMOUNT':
if ($mode == 'exchange') {
echo 'TRUE| CHECKAMOUNT orderId=' . $orderId . ', transactionId=' . $payNLTransactionID . ',idState:' . $idstate . ', service_id:' . $processor_data['processor_params']['service_id'] . ',token_api:' . $processor_data['processor_params']['token_api'] . ',statuses:' . print_r($processor_data['processor_params']['statuses'], true);
fn_updatePayTransaction($payNLTransactionID, 'CHECKAMOUNT');
die;
} else {
fn_updatePayTransaction($payNLTransactionID, 'CHECKAMOUNT');
fn_change_order_status($orderId, $idstate, '', false);
fn_order_placement_routines('route', $orderId, false);
}
break;
default:
$pp_response['order_status'] = $processor_data['processor_params']['statuses'][$state];
fn_updatePayTransaction($payNLTransactionID, 'PENDING');
fn_change_order_status($orderId, $pp_response['order_status'], '', false);
break;
}
}
示例15: fn_get_order_info
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
require './../../../payments/init_payment.php';
}
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'cancel') {
$order_info = fn_get_order_info($_REQUEST['order_id']);
fn_pp_save_mode($order_info);
if ($order_info['status'] == 'O' || $order_info['status'] == 'I') {
$pp_response['order_status'] = 'I';
$pp_response["reason_text"] = __('text_transaction_cancelled');
fn_finish_payment($order_info['order_id'], $pp_response);
}
fn_order_placement_routines('route', $_REQUEST['order_id'], false);
} else {
$order_id = !empty($_REQUEST['order_id']) ? $_REQUEST['order_id'] : 0;
$token = !empty($_REQUEST['token']) ? $_REQUEST['token'] : 0;
$payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id = ?i", $order_id);
$processor_data = fn_get_payment_method_data($payment_id);
$processor_data['processor_script'] = 'paypal_express.php';
$order_info = fn_get_order_info($order_id);
fn_pp_save_mode($order_info);
fn_paypal_complete_checkout($token, $processor_data, $order_info);
}
}
$mode = !empty($mode) ? $mode : (!empty($_REQUEST['mode']) ? $_REQUEST['mode'] : '');
if ($mode == 'express_return') {