示例#1
0
* 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.            *
****************************************************************************/
// rus_build_pack dbazhenov
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
    if ($mode == 'notify') {
        if (isset($_REQUEST['hash']) && isset($_REQUEST['type'])) {
            $processor_data = fn_get_processor_data_by_name('vsevcredit.php');
            $payment_data = fn_get_payment_by_processor($processor_data['processor_id']);
            $payment_data = reset($payment_data);
            $payment_params = fn_get_payment_method_data($payment_data['payment_id']);
            $secret_word = $payment_params['processor_params']['vvc_secret'];
            if ($_REQUEST['type'] == 'user') {
                if (md5($_REQUEST['user_code'] . $_REQUEST['email'] . $secret_word) === $_REQUEST['hash']) {
                    //For the anonymous checkout
                    die(0);
                }
            } elseif ($_REQUEST['type'] == 'order_status') {
                if (isset($_REQUEST['order_id']) && isset($_REQUEST['type']) && $_REQUEST['type'] != 'user') {
                    $order_id = (int) $_REQUEST['order_id'];
                    $order_info = fn_get_order_info($order_id);
                } else {
                    die('Access denied');
示例#2
0
/**
 * Check if store can use processor script
 *
 * @param string $processor name of processor script
 * @param string $area current working area
 * @return bool
 */
function fn_check_prosessor_status($processor, $area = AREA)
{
    $is_active = false;
    $processor = fn_get_processor_data_by_name($processor . '.php');
    if (!empty($processor)) {
        $payments = fn_get_payment_by_processor($processor['processor_id']);
        if (!empty($payments)) {
            foreach ($payments as $payment) {
                if ($payment['status'] == 'A' || $area == 'A') {
                    // admin can use disable payments
                    $is_active = true;
                }
            }
        }
    }
    return $is_active;
}
    error_log($msg, 3, $LOG_FILE);
}
// http://stackoverflow.com/a/768469/846892
function Redirect($url, $permanent = false)
{
    if (headers_sent() === false) {
        header('Location: ' . $url, true, $permanent === true ? 301 : 302);
    }
    exit;
}
if (defined('PAYMENT_NOTIFICATION')) {
    if ($mode == 'process') {
        $payment_id = $_REQUEST['payment_id'];
        // Get Instamojo details from backend
        instamojo_error_logger("Callback called with Payment ID: " . $payment_id);
        $processor_details = fn_get_processor_data_by_name('instamojo.php');
        $pdata = db_get_row("SELECT * FROM ?:payments WHERE processor_id = ?i", $processor_details['processor_id']);
        instamojo_error_logger("Instamojo processor details from DB: " . print_r($pdata, true));
        $processor_details['processor_params'] = unserialize($pdata['processor_params']);
        instamojo_error_logger("Instamojo's settings from DB: " . print_r($processor_details['processor_params'], true));
        $api_key = $processor_details['processor_params']['instamojo_api_key'];
        $auth_token = $processor_details['processor_params']['instamojo_auth_token'];
        $custom_field = $processor_details['processor_params']['instamojo_custom_field'];
        # Callback Instamojo
        $response = check_instamojo_payment_status($api_key, $auth_token, $payment_id);
        instamojo_error_logger("{$api_key} | {$auth_token} | {$custom_field}");
        instamojo_error_logger("Response from Instamojo is: " . print_r($response, true));
        instamojo_error_logger(print_r($response, true));
        $pp_response = array();
        if ($response['payment']['status'] == 'Credit') {
            instamojo_error_logger("Payment credited for Payment ID: " . $payment_id);