예제 #1
0
function eStore_auth_net_ipn_processor_listener()
{
    if (isset($_REQUEST['x_invoice_num']) && isset($_REQUEST['x_trans_id']) && isset($_REQUEST['x_amount'])) {
        if (get_option('eStore_use_authorize_gateway')) {
            //Auth.net is enabled
            //Process the IPN
        } else {
            eStore_payment_debug("Authorize.net payment gateway is not enabled in eStore settings. This IPN will not be processed", false);
        }
    } else {
        return;
    }
    status_header(200);
    include_once 'lib/gateway/Authorize.php';
    include_once 'eStore_process_payment_data.php';
    // Create an instance of the authorize.net library
    $myAuthorize = new Authorize();
    // Log the IPN results
    $debug_on = get_option('eStore_cart_enable_debug');
    if ($debug_on) {
        $myAuthorize->ipnLog = TRUE;
    }
    // Specify your authorize api and transaction id
    $authorize_login_id = get_option('eStore_authorize_login');
    $authorize_tx_key = get_option('eStore_authorize_tx_key');
    $myAuthorize->setUserInfo($authorize_login_id, $authorize_tx_key);
    // Enable test mode if needed
    if (get_option('eStore_cart_enable_sandbox')) {
        $myAuthorize->enableTestMode();
    }
    // Check validity and process
    if ($myAuthorize->validateIpn()) {
        handle_payment_data($myAuthorize->ipnData, "authorize");
    } else {
        $_SESSION['eStore_tx_result'] = $myAuthorize->lastError;
        //Ipn validation failed... redirect to the cancel URL
        $return = get_option('cart_cancel_from_paypal_url');
        if (empty($return)) {
            $return = get_bloginfo('wpurl');
        }
        $redirection_parameter = 'Location: ' . $return;
        header($redirection_parameter);
        exit;
    }
}
예제 #2
0
include_once 'eStore_process_payment_data.php';
status_header(200);
// Create an instance of the authorize.net library
$myAuthorize = new Authorize();
// Log the IPN results
$debug_on = get_option('eStore_cart_enable_debug');
if ($debug_on) {
    $myAuthorize->ipnLog = TRUE;
}
// Specify your authorize api and transaction id
$authorize_login_id = get_option('eStore_authorize_login');
$authorize_tx_key = get_option('eStore_authorize_tx_key');
$myAuthorize->setUserInfo($authorize_login_id, $authorize_tx_key);
// Enable test mode if needed
if (get_option('eStore_cart_enable_sandbox')) {
    $myAuthorize->enableTestMode();
}
// Check validity and process
if ($myAuthorize->validateIpn()) {
    handle_payment_data($myAuthorize->ipnData, "authorize");
} else {
    $_SESSION['eStore_tx_result'] = $myAuthorize->lastError;
    //Ipn validation failed... redirect to the cancel URL
    $return = get_option('cart_cancel_from_paypal_url');
    if (empty($return)) {
        $return = get_bloginfo('wpurl');
    }
    $redirection_parameter = 'Location: ' . $return;
    header($redirection_parameter);
    exit;
}
예제 #3
0
<?php

include_once '../../../wp-load.php';
include_once 'lib/gateway/TwoCo.php';
include_once 'eStore_process_payment_data.php';
$my2CO = new TwoCo();
// Log the INS results
$debug_on = get_option('eStore_cart_enable_debug');
if ($debug_on) {
    $my2CO->ipnLog = TRUE;
}
// Specify your 2co login and secret
$tco_secret_word = get_option('eStore_2co_secret_word');
$my2CO->setSecret($tco_secret_word);
// Enable test mode if needed
if (get_option('eStore_cart_enable_sandbox')) {
    $my2CO->enableTestMode();
}
// Check validity and write down it
if ($my2CO->validateIpn()) {
    $txn_id = $my2CO->ipnData['invoice_id'];
    if (eStore_txn_prcoessed($txn_id)) {
        eStore_do_thank_you_page_display_tasks_with_txn_id($txn_id);
    } else {
        handle_payment_data($my2CO->ipnData, "2co");
    }
} else {
    handle_payment_data($my2CO->ipnData, "2co");
}