Ejemplo n.º 1
0
                $pp_response['order_status'] = 'P';
                $pp_response["reason_text"] = fn_eway_get_response_message('', false, $response);
            }
            if (fn_check_payment_script('eway_rapidapi_rsp.php', $order_id)) {
                fn_finish_payment($order_id, $pp_response);
                fn_order_placement_routines('route', $order_id, false);
            }
        } else {
            $pp_response['order_status'] = 'F';
            $pp_response["reason_text"] = 'HTTP: ' . $response;
        }
    }
    exit;
}
$request = fn_eway_rapidapi_build_request($order_id, $order_info, $processor_data);
$request = array_merge($request, array('RedirectUrl' => fn_url("payment_notification.notify?payment=eway_rapidapi_rsp&order_id={$order_id}", AREA, 'current'), 'CancelUrl' => fn_url("payment_notification.cancel?payment=eway_rapidapi_rsp&order_id={$order_id}", AREA, 'current'), 'TransactionType' => 'Purchase', 'Method' => 'ProcessPayment', 'CustomView' => $processor_data['processor_params']['theme'], 'HeaderText' => $processor_data['processor_params']['headertext']));
$response = '';
if (fn_eway_rapidapi_request('AccessCodesShared', $request, $processor_data, $response)) {
    // Check if any error returns
    if (empty($response->Errors)) {
        $url = explode('?', $response->SharedPaymentUrl);
        $get_data = array('AccessCode' => $response->AccessCode);
        fn_create_payment_form(reset($url), $get_data, 'eWAY payment', true, 'get');
    } else {
        fn_set_notification('E', __('error'), fn_eway_get_response_message($response->Errors));
        fn_order_placement_routines('checkout_redirect');
    }
} else {
    fn_set_notification('E', __('error'), 'HTTP: ' . $response);
    fn_order_placement_routines('checkout_redirect');
}
Ejemplo n.º 2
0
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* 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')) {
    die('Access denied');
}
require_once Registry::get('config.dir.payments') . 'eway/eway_rapidapi.functions.php';
$request_eway = fn_eway_rapidapi_build_request($order_id, $order_info, $processor_data);
$request_eway['TransactionType'] = 'Purchase';
$request_eway['Customer']['CardDetails'] = array('Name' => $order_info['payment_info']['cardholder_name'], 'Number' => $order_info['payment_info']['card_number'], 'ExpiryMonth' => $order_info['payment_info']['expiry_month'], 'ExpiryYear' => $order_info['payment_info']['expiry_year'], 'CVN' => $order_info['payment_info']['cvv2']);
$response = '';
if (fn_eway_rapidapi_request('Transaction', $request_eway, $processor_data, $response)) {
    // Check if any error returns
    if (isset($response->Errors)) {
        fn_set_notification('E', __('error'), fn_eway_get_response_message($response->Errors));
        fn_order_placement_routines('checkout_redirect');
    }
    $successfully_code = array(0, 8, 10, 11, 16);
    if (in_array($response->ResponseCode, $successfully_code)) {
        $pp_response['order_status'] = 'P';
        $pp_response["transaction_id"] = $response->TransactionID;
        $pp_response["reason_text"] = fn_eway_get_response_message($response->ResponseMessage, false, $response);
    } else {
        $pp_response['order_status'] = 'F';
        $pp_response["reason_text"] = fn_eway_get_response_message($response->ResponseMessage);
    }
    if ($processor_data['processor_params']['mode'] == 'test') {