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);
    }
}
 $res_desc = $_POST['RESPMSG'];
 $checksum_recv = $_POST['CHECKSUMHASH'];
 $paramList = $_POST;
 if (fn_check_payment_script('paytm.php', $order_id, $processor_data)) {
     if (empty($processor_data)) {
         $processor_data = fn_get_processor_data($order_info['email']);
     }
     $secret_key = $processor_data["processor_params"]['secret_key'];
     $bool = "FALSE";
     $bool = verifychecksum_e($paramList, $secret_key, $checksum_recv);
     $paytmTxnIdText = "";
     if (isset($_POST['TXNID']) && !empty($_POST['TXNID'])) {
         $paytmTxnIdText = " Paytm Transaction Id : " . $_POST['TXNID'];
     }
     if (!empty($order_id)) {
         if (fn_check_payment_script('paytm.php', $order_id, $processor_data)) {
             $pp_response = array();
             $order_info = fn_get_order_info($order_id);
             if ($bool == "TRUE") {
                 if ($_REQUEST['RESPCODE'] == 01) {
                     $pp_response['order_status'] = 'P';
                     $pp_response['reason_text'] = "Thank you. Your order has been processed successfully." . $paytmTxnIdText;
                 } else {
                     $pp_response['order_status'] = 'F';
                     $pp_response['reason_text'] = "Thank you. Your order has been unsuccessfull" . $paytmTxnIdText;
                 }
             } else {
                 $pp_response['order_status'] = 'D';
                 $pp_response['reason_text'] = "Thank you. Your order has been declined due to security reasons." . $paytmTxnIdText;
             }
             fn_change_order_status($order_id, $pp_response['order_status']);
Example #3
0
            }
        } 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');
//
if (!defined('AREA')) {
    die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
    // to avoid bug with the '?' sign
    foreach ($_REQUEST as $k => $v) {
        if (preg_match("/\\?/", $v)) {
            $tmp = explode('?', $v);
            $_REQUEST[$k] = $tmp[0];
            $tmp = explode('=', $tmp[1]);
            $_REQUEST[$tmp[0]] = $tmp[1];
        }
    }
    $order_id = $_REQUEST['order_id'];
    if (!fn_check_payment_script('itransact_split_form.php', $order_id, $processor_data)) {
        exit;
    }
    $order_info = fn_get_order_info($order_id);
    $pp_response = array();
    $check_cntrl = md5('CNTRL_VALUE' . $order_id . $processor_data['params']['merchant_name'] . $order_info['total'] . $processor_data['params']['secret_key']);
    if (!empty($_REQUEST['xid']) && preg_match("/\\d+/", $_REQUEST['xid']) && $check_cntrl == $_REQUEST['cntrl']) {
        $pp_response['order_status'] = 'P';
        $pp_response['reason_text'] = fn_get_lang_var('transaction_approved');
        $pp_response['transaction_id'] = $_REQUEST['xid'];
    } else {
        $pp_response['order_status'] = 'F';
        $pp_response['reason_text'] = fn_get_lang_var('transaction_declined');
    }
    fn_finish_payment($order_id, $pp_response);
    fn_order_placement_routines($order_id);
Example #5
0
    }
} else {
    $pp_response['order_status'] = 'F';
    $pp_response['reason_text'] = '';
}
if (!empty($response['Status'])) {
    $pp_response['reason_text'] = 'Status: ' . @$response['StatusDetail'] . ' (' . $response['Status'] . ') ';
}
if (!empty($response['VPSTxId'])) {
    $pp_response['transaction_id'] = $response['VPSTxId'];
}
if (!empty($response['AVSCV2']) && $response['AVSCV2'] != 'DATA NOT CHECKED') {
    $pp_response['reason_text'] .= ' (AVS/CVV2: {' . $response['AVSCV2'] . '})  ';
}
if (!empty($response['AddressResult']) && $response['AddressResult'] != 'NOTPROVIDED') {
    $pp_response['reason_text'] .= ' (Address: {' . $response['AddressResult'] . '})  ';
}
if (!empty($response['PostCodeResult']) && $response['PostCodeResult'] != 'NOTPROVIDED') {
    $pp_response['reason_text'] .= ' (PostCode: {' . $response['PostCodeResult'] . '})  ';
}
if (!empty($response['CV2Result']) && $response['CV2Result'] != 'NOTPROVIDED') {
    $pp_response['reason_text'] .= ' (CV2: {' . $response['CV2Result'] . '})  ';
}
if (!empty($response['3DSecureStatus'])) {
    $pp_response['reason_text'] .= ' (3D Result: {' . $response['3DSecureStatus'] . '})  ';
}
if (!empty($secure_verified_3d) && !empty($order_id) && fn_check_payment_script('sagepay_direct.php', $order_id) == true) {
    unset($_SESSION['already_posted']);
    fn_finish_payment($order_id, $pp_response, false);
    fn_order_placement_routines('route', $order_id);
}
Example #6
0
            fn_order_placement_routines('route', $_REQUEST['order_id']);
        }
        // Fraud checking notification
    } elseif (!empty($_REQUEST['message_type']) && $_REQUEST['message_type'] == 'FRAUD_STATUS_CHANGED') {
        if (!empty($_REQUEST['vendor_order_id'])) {
            list($order_id) = explode('_', $_REQUEST['vendor_order_id']);
            if (!empty($order_id)) {
                $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);
                $pp_response = array();
                if ($_REQUEST['fraud_status'] == 'pass') {
                    $pp_response['order_status'] = 'P';
                } elseif ($_REQUEST['fraud_status'] == 'fail') {
                    $pp_response['order_status'] = $processor_data['processor_params']['fraud_fail'];
                }
                if (!empty($pp_response) && fn_check_payment_script('2checkout.php', $order_id)) {
                    fn_finish_payment($order_id, $pp_response);
                }
            }
        }
    }
    exit;
} else {
    $__bstate = $order_info['b_state'];
    if ($order_info['b_country'] != 'US' && $order_info['b_country'] != 'CA') {
        $__bstate = "XX";
    }
    $__sstate = @$order_info['s_state'];
    if ($order_info['s_country'] != 'US' && $order_info['s_country'] != 'CA') {
        $__sstate = "XX";
    }
Example #7
0
            $key = md5($processor_data['processor_params']['key2'] . md5($processor_data['processor_params']['key1'] . 'transact=' . $_REQUEST['transact'] . '&amount=' . $amount . '&currency=' . $processor_data['processor_params']['currency']));
            $key_with_fee = md5($processor_data['processor_params']['key2'] . md5($processor_data['processor_params']['key1'] . 'transact=' . $_REQUEST['transact'] . '&amount=' . $amount_with_fee . '&currency=' . $processor_data['processor_params']['currency']));
        }
        if (!empty($_REQUEST['transact']) && ($_REQUEST['authkey'] == $key || $_REQUEST['authkey'] == $key_with_fee)) {
            $pp_response['order_status'] = 'P';
            $pp_response['reason_text'] = __('transaction_approved');
            $pp_response['transaction_id'] = $_REQUEST['transact'];
        } else {
            $pp_response['order_status'] = 'F';
            $pp_response['reason_text'] = __('transaction_declined');
        }
    } else {
        $pp_response['order_status'] = 'F';
        $pp_response['reason_text'] = __('transaction_declined');
    }
    if (fn_check_payment_script('dibs.php', $order_id)) {
        fn_finish_payment($order_id, $pp_response);
        fn_order_placement_routines('route', $order_id);
    }
} else {
    $currencies = array(208 => 'DKK', 978 => 'EUR', 840 => 'USD', 826 => 'GBP', 752 => 'SEK', 036 => 'AUD', 124 => 'CAD', 352 => 'ISK', 392 => 'JPY', 554 => 'NZD', 578 => 'NOK', 756 => 'CHF', 949 => 'TRY');
    $languages = array("da", "sv", "no", "en", "nl", "de", "fr", "fi", "es", "it", "fo", "pl");
    $post_address = "https://payment.architrade.com/paymentweb/start.action";
    $msg = __('text_cc_processor_connection', array('[processor]' => 'DIBS'));
    $lang_code = Registry::get('settings.Appearance.backend_default_language');
    $post = array();
    $post['order_id'] = $processor_data['processor_params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id);
    $post['currency'] = $processor_data['processor_params']['currency'];
    $post['amount'] = $order_info['total'] * 100;
    $post['accepturl'] = fn_url("payment_notification.accept?payment=dibs&order_id={$order_id}", AREA, 'current');
    $post['cancelurl'] = fn_url("payment_notification.cancel?payment=dibs&order_id={$order_id}", AREA, 'current');
Example #8
0
            $pp_response = array();
            if ($status[1] == 'Success') {
                $pp_response['order_status'] = 'P';
            } elseif ($status[1] == 'Open') {
                $pp_response['order_status'] = 'O';
            } elseif ($status[1] == 'Cancelled') {
                $pp_response['order_status'] = 'I';
            } else {
                $pp_response['order_status'] = 'F';
            }
            $pp_response['reason_text'] = "Status code: " . $status[1];
            $dat = $date[1];
            $time = $dat[0] . $dat[1] . $dat[2] . $dat[3] . '-' . $dat[4] . $dat[5] . '-' . $dat[6] . $dat[7] . ' ' . $dat[8] . $dat[9] . ':' . $dat[10] . $dat[11] . ':' . $dat[12] . $dat[13];
            $pp_response['reason_text'] .= " (TimeStamp: " . $time . ")";
            $pp_response['transaction_id'] = $transaction[1];
            if (fn_check_payment_script('ideal_basic.php', $order_id)) {
                fn_finish_payment($order_id, $pp_response);
                // Force customer notification
            }
        }
    }
} else {
    $langs = array("US" => "en_US", "FR" => "fr_FR", "NL" => "nl_NL", "IT" => "it_IT", "DE" => "de_DE", "ES" => "es_ES", "NO" => "no_NO", "en" => "en_EN");
    $validUntil = date("Y-m-d\\TH:i:s", time() + 3600 + date('Z'));
    $validUntil = $validUntil . ".000Z";
    $pp_merch = $processor_data['processor_params']['merchant_id'];
    $pp_secret = $processor_data['processor_params']['merchant_key'];
    $pp_curr = $processor_data['processor_params']['currency'];
    $pp_test = $processor_data['processor_params']['test'] == 'TRUE' ? "https://idealtest.secure-ing.com/ideal/mpiPayInitIng.do" : "https://ideal.secure-ing.com/ideal/mpiPayInitIng.do";
    $pp_lang = $processor_data['processor_params']['language'];
    $order_total = $order_info['total'] * 100;
Example #9
0
        $pxaccess = new PxAccess($PxAccess_Url, $PxAccess_Userid, $PxAccess_Key, $Mac_Key);
        $enc_hex = $result;
        //getResponse method in PxAccess object returns PxPayResponse object
        //which encapsulates all the response data
        $rsp = $pxaccess->getResponse($enc_hex);
        $order_alias = $rsp->getMerchantReference();
        $order_id = strpos($order_alias, '_') ? substr($order_alias, 0, strpos($order_alias, '_')) : $order_alias;
        $pp_response = array();
        $pp_response['order_status'] = $rsp->getSuccess() == "1" ? 'P' : 'F';
        $pp_response['reason_text'] = $rsp->getResponseText();
        if ($pp_response['order_status'] == 'P') {
            $pp_response['reason_text'] .= "; Auth code: " . $rsp->getAuthCode();
            // from bank
        }
        $pp_response['transaction_id'] = $rsp->getDpsTxnRef();
        if (fn_check_payment_script('dps_access.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
        }
        fn_order_placement_routines($order_id);
    }
} elseif (isset($_REQUEST['result'])) {
    DEFINE('AREA', 'C');
    DEFINE('AREA_NAME', 'customer');
    require './../prepare.php';
    require './../init.php';
    $_SESSION['dps_access']['result'] = $_REQUEST['result'];
    fn_redirect(Registry::get('config.current_location') . '/' . Registry::get('config.customer_index') . "?dispatch=payment_notification.notify&payment=dps_access&order_id={$_SESSION['dps_access']['order_id']}");
} else {
    if (!defined('AREA')) {
        die('Access denied');
    }
Example #10
0
****************************************************************************/
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;
Example #11
0
        if (!empty($_REQUEST['numauto'])) {
            $pp_response["order_status"] = 'P';
            $pp_response["reason_text"] = "NumAuto: " . $_REQUEST['numauto'];
        } 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 = Registry::get('config.http_location') . "/payments/paybox_files/modulev2.cgi";
    $pbx_devise = $processor_data['params']['currency'];
    $r_url = Registry::get('config.current_location') . "/{$index_script}?dispatch=payment_notification.process&payment=paybox&order_id={$order_id}&sl=" . CART_LANGUAGE;
    $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;
    echo <<<EOT
Example #12
0
        }
        $post_data = array();
        $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);
Example #13
0
    if ($mode == 'notify') {
        $order_info = fn_get_order_info($_REQUEST['order_id']);
        if ($order_info['status'] == 'O') {
            $pp_response = array();
            $pp_response['order_status'] = 'F';
            $pp_response['reason_text'] = 'No response recieved';
            fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
        }
        fn_order_placement_routines('route', $_REQUEST['order_id']);
    } elseif ($mode == 'tvp') {
        $msg = __('epassporte_msg');
        $pp_response = array();
        $pp_response['order_status'] = substr($_REQUEST['ans'], 0, 1) == 'Y' ? 'P' : 'F';
        $pp_response['reason_text'] = __('order_id') . '-' . $_REQUEST['order_id'];
        $pp_response['transaction_id'] = $_REQUEST['credit_trans_idx'];
        if (fn_check_payment_script('epassporte.php', $_REQUEST['order_id'])) {
            fn_finish_payment($_REQUEST['order_id'], $pp_response);
        }
        echo <<<EOT
<form method="post" action="https://www.epassporte.com/secure/eppurchaseverify.cgi" name="process">
<input type="hidden" name="credit_trans_idx" value="{$credit_trans_idx}">
<input type="hidden" name="debit_trans_idx" value="{$debit_trans_idx}">
<input type="hidden" name="total_amount" value="{$total_amount}">
<input type="hidden" name="action" value="verify">
<input type="hidden" name="msg" value="{$msg}">
</form>
<script type="text/javascript">
window.onload = function(){
    document.process.submit();
};
</script>
Example #14
0
            $pp_response['reason_text'] = __('kupivkredit_widget_incomplete');
        } elseif ($decision == 'closed') {
            $pp_response['order_status'] = 'I';
            $pp_response['reason_text'] = __('kupivkredit_widget_closed');
        } elseif ($decision == 'rej') {
            $pp_response['order_status'] = 'D';
            $pp_response['reason_text'] = __('kupivkredit_widget_bank_reject');
        } elseif ($decision == 'ver') {
            $pp_response['order_status'] = 'O';
            $pp_response['reason_text'] = __('kupivkredit_widget_open');
        } elseif ($decision == 'agr') {
            $pp_response['order_status'] = 'P';
            $pp_response['reason_text'] = __('kupivkredit_widget_processed');
        }
    }
    if (fn_check_payment_script('kupivkredit.php', $order_id)) {
        fn_finish_payment($order_id, $pp_response);
        fn_order_placement_routines('route', $order_id, false);
    }
} else {
    $url = $processor_data['processor_params']['test'] == 'Y' ? 'https://' . KVK_WIDGET_TEST_URL : 'https://' . KVK_WIDGET_URL;
    $kvk_order_id = ($order_info['repaid'] ? $order_info['order_id'] . '_' . $order_info['repaid'] : $order_info['order_id']) . '_' . fn_date_format(time(), '%H_%M_%S');
    //We should save this iformation for the actions such as 'confirm order', 'cancel order' in the admin area.
    fn_update_order_payment_info($order_id, array('kvk_order_id' => $kvk_order_id));
    $order = array();
    foreach ($order_info['products'] as $k => $item) {
        $price = fn_format_price(($item['subtotal'] - fn_external_discounts($item)) / $item['amount']);
        $order['items'][] = array('title' => $item['product'], 'category' => db_get_field("SELECT ?:category_descriptions.category FROM ?:category_descriptions LEFT JOIN ?:products_categories ON ?:category_descriptions.category_id = ?:products_categories.category_id WHERE ?:products_categories.product_id = ?i AND ?:products_categories.link_type = ?s AND ?:category_descriptions.lang_code = ?s", $item['product_id'], 'M', $order_info['lang_code']), 'qty' => $item['amount'], 'price' => fn_format_rate_value($price, 'F', 0, '.', '', ''));
    }
    if (!empty($order_info['shipping_cost'])) {
        $order['items'][] = array('title' => __('shipping_cost'), 'category' => '', 'qty' => 1, 'price' => fn_format_rate_value($order_info['shipping_cost'], 'F', 0, '.', '', ''));
Example #15
0
     $order_status = 'P';
     $pp_response = array('order_status' => $order_status);
     if (!empty($processor_data['processor_params']['postponed_payments_enabled']) && $processor_data['processor_params']['postponed_payments_enabled'] == 'Y') {
         $pp_response['order_status'] = $processor_data['processor_params']['unconfirmed_order_status'];
         $pp_response['yandex_postponed_payment'] = true;
         $pp_response['yandex_invoice_id'] = $invoiceId;
         $pp_response['yandex_merchant_order_id'] = $_REQUEST['merchant_order_id'];
     }
     if (fn_check_payment_script('yandex_money.php', $order_id)) {
         fn_finish_payment($order_id, $pp_response);
     }
 } else {
     $code = 1;
     $pp_response['order_status'] = 'N';
     $pp_response["reason_text"] = __('error');
     if (fn_check_payment_script('yandex_money.php', $order_id)) {
         fn_finish_payment($order_id, $pp_response, false);
     }
 }
 $dom = new DOMDocument('1.0', 'utf-8');
 $item = $dom->createElement('paymentAvisoResponse');
 $item->setAttribute('performedDatetime', $date_time);
 $item->setAttribute('code', $code);
 $item->setAttribute('invoiceId', $invoiceId);
 $item->setAttribute('shopId', $shop_id);
 $dom->appendChild($item);
 echo $dom->saveXML();
 if (!empty($processor_data['processor_params']['logging']) && $processor_data['processor_params']['logging'] == 'Y') {
     fn_yandex_money_log_write($dom->saveXML(), 'ym_payment_aviso.log');
 }
 exit;
Example #16
0
                $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;
}
Example #17
0
 $pp_response['order_status'] = 'F';
 $pp_response['reason_text'] = __('text_transaction_declined');
 $order_id = !empty($_REQUEST['order_id']) ? (int) $_REQUEST['order_id'] : 0;
 if ($mode == 'response' && !empty($_REQUEST['order_id'])) {
     $order_info = fn_get_order_info($order_id);
     if (empty($processor_data)) {
         $processor_data = fn_get_processor_data($order_info['payment_id']);
     }
     $option = array('merchant_id' => $processor_data['processor_params']['fondy_merchantid'], 'secret_key' => $processor_data['processor_params']['fondy_merchnatSecretKey']);
     $response = FondyCls::isPaymentValid($option, $_POST);
     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'];
             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);
         }
     }
 }
Example #18
0
         }
         if (!empty($_REQUEST['payer_id'])) {
             $pp_response['client_id'] = $_REQUEST['payer_id'];
         }
         if (!empty($_REQUEST['memo'])) {
             $pp_response['customer_notes'] = $_REQUEST['memo'];
         }
         if ($pp_response['order_status'] == $paypal_statuses['pending']) {
             fn_change_order_status($_REQUEST['order_id'], $pp_response['order_status']);
         } else {
             fn_finish_payment($_REQUEST['order_id'], $pp_response);
         }
     }
     exit;
 } elseif ($mode == 'return') {
     if (fn_check_payment_script('paypal.php', $_REQUEST['order_id'])) {
         $order_info = fn_get_order_info($_REQUEST['order_id'], true);
         if ($order_info['status'] == STATUS_INCOMPLETED_ORDER) {
             fn_change_order_status($_REQUEST['order_id'], 'O', '', false);
         }
         if (fn_allowed_for('MULTIVENDOR')) {
             if ($order_info['status'] == STATUS_PARENT_ORDER) {
                 $child_orders = db_get_hash_single_array("SELECT order_id, status FROM ?:orders WHERE parent_order_id = ?i", array('order_id', 'status'), $_REQUEST['order_id']);
                 foreach ($child_orders as $order_id => $order_status) {
                     if ($order_status == STATUS_INCOMPLETED_ORDER) {
                         fn_change_order_status($order_id, 'O', '', false);
                     }
                 }
             }
         }
     }
Example #19
0
    die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
    if (empty($_REQUEST['refno'])) {
        if (!empty($_SESSION['thaiepay_refno'])) {
            $_REQUEST['refno'] = $_SESSION['thaiepay_refno'];
            unset($_SESSION['thaiepay_refno']);
        } else {
            if ($mode == 'finish') {
                fn_order_placement_routines('checkout_redirect');
            }
            exit;
        }
    }
    $order_id = intval($_REQUEST['refno']);
    if (fn_check_payment_script('thaiepay.php', $order_id, $processor_data)) {
        if ($mode == 'notify') {
            $errors = array();
            $errors_desc = array('additional_parameter' => __('additional_parameter_not_correct'), 'total' => __('order_total_not_correct'));
            if (isset($_REQUEST['total'])) {
                $order_info = fn_get_order_info($order_id);
                if (fn_format_price($order_info['total']) != fn_format_price($_REQUEST['total'])) {
                    $errors['total'] = true;
                }
            }
            $param_name = !empty($processor_data['processor_params']['add_param_name']) ? $processor_data['processor_params']['add_param_name'] : '';
            $param_value = !empty($processor_data['processor_params']['add_param_value']) ? $processor_data['processor_params']['add_param_value'] : '';
            $sec_param = !empty($param_name) && !empty($_REQUEST[$param_name]) ? $_REQUEST[$param_name] : '';
            if (empty($param_value) || empty($sec_param) || $sec_param != $param_value) {
                $errors['additional_parameter'] = true;
            }
Example #20
0
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');
            } elseif ($realex_response_code == 101) {
                // Declined by Bank – generally insufficient funds or incorrect expiry date.
                $pp_response['order_status'] = $realex_statuses['declined'];
Example #21
0
    $pxaccess = new PxAccess($PxAccess_Url, $PxAccess_Userid, $PxAccess_Key, $Mac_Key);
    $enc_hex = $result;
    $rsp = $pxaccess->getResponse($enc_hex);
    $order_alias = $rsp->getMerchantReference();
    $_order_id = !empty($order_alias) ? $order_alias : Tygh::$app['session']['dps_access']['order_id'];
    $order_id = strpos($_order_id, '_') ? substr($_order_id, 0, strpos($_order_id, '_')) : $_order_id;
    $pp_response = array();
    $pp_response['order_status'] = $rsp->getSuccess() == "1" ? 'P' : 'F';
    $pp_response['reason_text'] = $rsp->getResponseText();
    if ($pp_response['order_status'] == 'P') {
        $pp_response['reason_text'] .= "; Auth code: " . $rsp->getAuthCode();
        // from bank
    }
    $pp_response['transaction_id'] = $rsp->getDpsTxnRef();
    //This payment send two absolutely identical response, so, to avoid double email notifications we should check session data
    if (!isset(Tygh::$app['session']['dps_access']) && fn_check_payment_script('dps_access.php', $order_id)) {
        fn_finish_payment($order_id, $pp_response, false);
    } else {
        fn_order_placement_routines('route', $order_id);
    }
} else {
    if (!defined('BOOTSTRAP')) {
        die('Access denied');
    }
    // This file is a SAMPLE showing redirect to Payments Page from PHP.
    //Inlcude PxAccess Objects
    include Registry::get('config.dir.payments') . 'dps_files/pxaccess.inc';
    $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"];
*    Copyright (c) 2009 Simbirsk Technologies Ltd. All rights reserved.    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* 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.            *
****************************************************************************/
//
// $Id: proxypay3_confirmation.php 7502 2009-05-19 14:54:59Z zeke $
//
DEFINE('AREA', 'C');
DEFINE('AREA_NAME', 'customer');
require './../prepare.php';
require './../init.php';
if (!empty($_REQUEST['Ref'])) {
    $order_id = strpos($_REQUEST['Ref'], '_') ? substr($_REQUEST['Ref'], 0, strpos($_REQUEST['Ref'], '_')) : $_REQUEST['Ref'];
    if (fn_check_payment_script('proxypay3.php', $order_id)) {
        fn_change_order_status($order_id, 'P', '', true);
        $pp_response = array();
        $pp_response['order_status'] = 'P';
        print '[OK]';
    } else {
        $pp_response['reason_text'] = 'Error in data confirmation';
        // FIXME: this variable is not used
        print '[ERROR]';
    }
}
exit;
Example #23
0
            $pp_response['order_status'] = 'F';
        }
        if (fn_check_payment_script('piraeus.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
        }
        fn_order_placement_routines('route', $order_id);
    } elseif ($mode == 'cancel') {
        if (!empty($_SESSION['stored_piraeus_orderid'])) {
            $order_id = $_SESSION['stored_piraeus_orderid'];
            unset($_SESSION['stored_piraeus_orderid']);
        } else {
            fn_order_placement_routines('checkout_redirect');
        }
        $pp_response['order_status'] = 'N';
        $pp_response["reason_text"] = __('text_transaction_cancelled');
        if (fn_check_payment_script('piraeus.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
        }
        fn_order_placement_routines('route', $order_id);
    }
} else {
    $ticketing_data = array('AcquirerId' => $processor_data['processor_params']['acquirerid'], 'MerchantId' => $processor_data['processor_params']['merchantid'], 'PosId' => $processor_data['processor_params']['posid'], 'Username' => $processor_data['processor_params']['username'], 'Password' => md5($processor_data['processor_params']['password']), 'RequestType' => $processor_data['processor_params']['requesttype'], 'CurrencyCode' => $processor_data['processor_params']['currencycode'], 'MerchantReference' => $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id, 'Amount' => $order_info['total'], 'Installments' => 0, 'Bnpl' => 0, 'ExpirePreauth' => $processor_data['processor_params']['requesttype'] == '00' ? $processor_data['processor_params']['expirepreauth'] : '0', 'Parameters' => '');
    $str = <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<IssueNewTicket xmlns="http://piraeusbank.gr/paycenter/redirection">
<Request>
EOT;
    $str .= fn_array_to_xml($ticketing_data);
    $str .= <<<EOT
Example #24
0
            if (isset($result[$add_field]) && strlen($result[$add_field]) > 0) {
                $additional_fields[] = ' ' . $add_field . ': ' . $result[$add_field];
            }
        }
        if (!empty($additional_fields)) {
            $reason_text .= ' (' . implode(', ', $additional_fields) . ')';
        }
        if (!empty($result['error'])) {
            $reason_text .= sprintf(" Error: %s (Code: %s%s)", $result['error']['LongMessage'], $result['error']['ErrorCode'], isset($result['error']['Severity']) ? ' , Severity:' . $result['error']['Severity'] : '');
        }
        $pp_response['reason_text'] = $reason_text;
        if (preg_match("/<TransactionID>(.*)<\\/TransactionID>/", $result['response'], $transaction)) {
            $pp_response['transaction_id'] = $transaction[1];
        }
        unset($_SESSION['pp_express_details']);
        if (fn_check_payment_script('paypal_express.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
            fn_order_placement_routines($order_id);
        }
    }
}
function fn_paypal_request($request, $post_url, $cert_file)
{
    $post = explode("\n", $request);
    list($headers, $response) = fn_https_request("POST", $post_url, $post, "", "", "text/xml", "", $cert_file);
    if ($headers == "0") {
        return array('success' => false, 'error' => array('ShortMessage' => $response, 'LongMessage' => $response, 'ErrorCode' => 0));
    }
    $result = array('headers' => $headers, 'response' => $response);
    #
    # Parse and fill common fields
Example #25
0
            $order_n = $_REQUEST['order_id'] . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : '');
        } else {
            $order_n = str_repeat('0', 6 - strlen($order_id)) . $_REQUEST['order_id'] . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : '');
        }
        $amount = $currency == '978' ? $order_info['total'] * 100 : $order_info['total'];
        $signature = strtoupper(sha1($amount . $order_n . $merchant . $currency . $_REQUEST['Ds_Response'] . $clave));
        $pp_response = array();
        $pp_response['order_status'] = ($_REQUEST['Ds_Response'] == '0000' || $_REQUEST['Ds_Response'] == '0099') && $_REQUEST['Ds_Signature'] == $signature ? 'P' : 'F';
        $pp_response['reason_text'] = $response_mess[$_REQUEST['Ds_Response']];
        if ($pp_response['order_status'] == 'P') {
            $pp_response['transaction_id'] = $_REQUEST['Ds_AuthorisationCode'];
        }
        fn_finish_payment($order_id, $pp_response);
        exit;
    } elseif ($mode == 'failed') {
        if (!empty($order_id) && fn_check_payment_script('servired.php', $order_id)) {
            $pp_response = array('order_status' => 'F', 'reason_text' => __('text_transaction_declined'));
            fn_finish_payment($order_id, $pp_response);
            fn_order_placement_routines('route', $order_id);
        }
        exit;
    }
} else {
    $post_address = $processor_data['processor_params']['test'] == 'Y' ? "https://sis-t.sermepa.es:25443/sis/realizarPago" : "https://sis.sermepa.es/sis/realizarPago";
    /*
    Transaction types
     0 - Authorization
     1 - Pre-authorization
     2 - Confirmation
     3 -Automatic Refund
     4 - Payment by Cell Phone
Example #26
0
        $order_info = fn_get_order_info($order_id);
        $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);
        $pp_response = array();
        if (($_REQUEST['etat'] == '1' || $_REQUEST['etat'] == '99') && html_entity_decode($_REQUEST['siret']) == $processor_data['processor_params']['merchant_id'] && fn_format_price($order_info['total']) == fn_format_price(html_entity_decode($_REQUEST['montant'])) && $processor_data['processor_params']['currency'] == html_entity_decode($_REQUEST['devise'])) {
            $pp_response['order_status'] = 'P';
            $pp_response['reason_text'] = __('approved');
            $pp_response['transaction_id'] = $_REQUEST['refsfp'];
            if ($_REQUEST['etat'] == '99') {
                $pp_response['reason_text'] .= '; ' . __('the_test_transaction');
            }
        } else {
            $pp_response['order_status'] = 'F';
            $pp_response['reason_text'] = __('declined');
        }
        if (fn_check_payment_script('spplus.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
        }
        fn_order_placement_routines('route', $order_id);
    }
    die('Access denied');
} else {
    if (!extension_loaded('SPPLUS')) {
        die('SPPLUS extension (http://pecl.php.net/package/spplus) must be installed');
    }
    $clent = $processor_data['processor_params']['clent'];
    $codesiret = $processor_data['processor_params']['merchant_id'];
    $devise = $processor_data['processor_params']['currency'];
    $langue = $processor_data['processor_params']['language'];
    $montant = $order_info['total'];
    $email = $order_info['email'];
Example #27
0
*                                                                          *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* 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.            *
****************************************************************************/
use Tygh\Registry;
if (!empty($_REQUEST['etat']) && !empty($_REQUEST['id_trans']) && !empty($_REQUEST['devise_sent']) && !empty($_REQUEST['divers']) && !empty($_REQUEST['ref'])) {
    require './init_payment.php';
    $order_id = intval($_REQUEST['ref']);
    if (fn_check_payment_script('paysitecash.php', $order_id)) {
        //Parse "divers"
        $divers = array();
        parse_str(base64_decode($_REQUEST['divers']), $divers);
        //Params check
        if ($divers['key'] != md5(fn_format_price($_REQUEST['montant_sent'], CART_PRIMARY_CURRENCY, null, false) . Registry::get('config.crypt_key') . $_REQUEST['ref'])) {
            exit('Wrong checksum');
        }
        $etat = $_REQUEST['etat'];
        $id_trans = $_REQUEST['id_trans'];
        $order_id = intval($_REQUEST['ref']);
        $devise = $_REQUEST['devise_sent'];
        $error = !empty($_REQUEST['errordetail']) ? urldecode($_REQUEST['errordetail']) : '';
        if ($devise != CART_PRIMARY_CURRENCY) {
            $etat = 'currency';
        }
Example #28
0
    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;
}
Example #29
0
        $pp_response = array('order_status' => 'F', 'pp_response' => '', 'reason_text' => '');
        $order_id = $_REQUEST['order_id'];
        if (!empty($_REQUEST['payment_number'])) {
            $pp_response['transaction_id'] = $_REQUEST['payment_number'];
            $conf_key = db_get_field("SELECT data FROM ?:order_data WHERE type = 'E' AND order_id = ?i", $order_id);
            if (empty($conf_key) || $conf_key != $_REQUEST['conf_key']) {
                $pp_response['reason_text'] .= 'Confirmation key does not match; ';
            } else {
                db_query("DELETE FROM ?:order_data WHERE type = 'E' AND order_id = ?i", $order_id);
                $pp_response['order_status'] = 'P';
            }
        } else {
            $pp_response['reason_text'] .= 'Payment number is empty; ';
        }
        $pp_response['reason_text'] .= "Received from: " . $_SERVER['REMOTE_ADDR'];
        if (fn_check_payment_script('direct_one.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response);
        }
    }
} else {
    $conf_key = md5($order_id . TIME . Tygh::$app['session']['auth']['user_id']);
    $data = array('order_id' => $order_id, 'type' => 'E', 'data' => $conf_key);
    db_query("REPLACE INTO ?:order_data ?e", $data);
    $submit_url = 'https://vault.safepay.com.au/cgi-bin/' . ($processor_data['processor_params']['mode'] == 'live' ? 'make' : 'test') . '_payment.pl';
    $return_url = fn_url("payment_notification.notify?payment=direct_one&order_id={$order_id}", AREA, 'current');
    $process_url = fn_url("payment_notification.process?payment=direct_one&order_id={$order_id}&payment_number=&conf_key={$conf_key}", AREA, 'current');
    $post_data = array('vendor_name' => $processor_data['processor_params']['merchant_id'], 'return_link_url' => $return_url, 'reply_link_url' => $process_url, 'Billing_name' => $order_info['b_firstname'], 'Billing_address1' => $order_info['b_address'], 'Billing_address2' => $order_info['b_address_2'], 'Billing_city' => $order_info['b_city'], 'Billing_state' => $order_info['b_state_descr'], 'Billing_zip' => $order_info['b_zipcode'], 'Billing_country' => $order_info['b_country_descr'], 'Delivery_name' => $order_info['s_firstname'], 'Delivery_address1' => $order_info['s_address'], 'Delivery_address2' => $order_info['s_address_2'], 'Delivery_city' => $order_info['s_city'], 'Delivery_state' => $order_info['s_state_descr'], 'Delivery_zip' => $order_info['s_zipcode'], 'Delivery_country' => $order_info['s_country_descr'], 'Contact_email' => $order_info['email'], 'Contact_phone' => $order_info['phone'], 'information_fields' => 'Billing_name,Billing_address1,Billing_address2,Billing_city,Billing_state,Billing_zip,Billing_country,Delivery_name,Delivery_address1,Delivery_address2,Delivery_city,Delivery_state,Delivery_zip,Delivery_country,Contact_email,Contact_phone', 'suppress_field_names' => '', 'hidden_fields' => '', 'print_zero_qty' => false);
    if (empty($order_info['use_gift_certificates']) && !floatval($order_info['subtotal_discount']) && empty($order_info['points_info']['in_use'])) {
        // Products
        if (!empty($order_info['products'])) {
            foreach ($order_info['products'] as $k => $v) {
Example #30
0
        $order_id = strpos($_REQUEST['merchantreference'], '_') ? substr($_REQUEST['merchantreference'], 0, strpos($_REQUEST['merchantreference'], '_')) : $_REQUEST['merchantreference'];
        $order_info = fn_get_order_info($order_id);
        if (in_array($_REQUEST['responsecode'], array('00', '08', '10', '11', '16'))) {
            $pp_response['order_status'] = 'P';
            $pp_response["reason_text"] = 'Response code: ' . $_REQUEST['responsecode'] . ' (' . $_REQUEST['responsedescription'] . ')';
        } else {
            $pp_response['order_status'] = 'F';
            if (!empty($_REQUEST['errordescription'])) {
                $pp_response["reason_text"] = 'Response code: ' . $_REQUEST['responsecode'] . ' (' . $_REQUEST['errordescription'] . ')';
            } else {
                $pp_response["reason_text"] = 'Response code: ' . $_REQUEST['responsecode'] . ' (' . $_REQUEST['responsedescription'] . ')';
            }
        }
        $pp_response['transaction_id'] = $_REQUEST['transactionid'];
    }
    if (fn_check_payment_script('winbank.php', $order_id)) {
        fn_finish_payment($order_id, $pp_response, false);
    }
    fn_order_placement_routines($order_id);
} else {
    $return_url = Registry::get('config.current_location') . "/{$index_script}?dispatch=payment_notification.failed&payment=winbank&order_id={$order_id}";
    $_order_id = $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id;
    $_order_total = $order_info['total'] * 100;
    echo <<<EOT
<html>
<body onload="javascript: document.process.submit();">
<form method="post" action="https://paycenter.winbank.gr/ePos2003/winpay.asp" name="process">
\t<input type="hidden" name="merchantid" value="{$processor_data['params']['merchant_id']}" />
\t<input type="hidden" name="posid" value="{$processor_data['params']['pos_id']}" />
\t<input type="hidden" name="user" value="{$processor_data['params']['user']}" />
\t<input type="hidden" name="merchantreference" value="{$_order_id}" />