示例#1
0
<?php

if (!isset($_POST['Result']) || $_POST['Result'] != 'SUCCESS') {
    header("Location:/");
    exit;
}
require_once '../../../config.inc.php';
require_once dirname(__FILE__) . '/skypay.php';
/*                                                                          */
/* Validation module to handle the Skypay transaction response callback		*/
/* It gets the response sent by skypay and records it - updates the payment	*/
/*                                                                          */
$skypay = new Skypay($config['payment']['skypay']);
// CLEAN POST BEFORE PROCESSING
$postData = $skypay->cleanPost($_POST);
$skypay->skypayDebug("Callback Response: " . print_r($postData, 1));
$skypay->recordResponse($postData);
示例#2
0
<?php

if (!defined('INCLUDED_AMEMBER_CONFIG')) {
    die("Direct access to this location is not allowed");
}
$notebook_page = 'Skypay';
config_set_notebook_comment($notebook_page, 'Skypay Configuration');
if (file_exists($rm = dirname(__FILE__) . "/readme.txt")) {
    config_set_readme($notebook_page, $rm);
}
add_config_field('payment.skypay.username', 'Skypay Username', 'text', "Username for payment API.", $notebook_page, '');
add_config_field('payment.skypay.password', 'Skypay Password', 'text', "Password for payment API.", $notebook_page, '');
add_config_field('payment.skypay.testMode', 'Test Mode Enabled', 'select', "If set to 'Yes' then only test card details will operate.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.skypay.dispatch', 'Dispatch', 'select', "Whether the payment should be taken immediately.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.skypay.dispatchAmount', 'Dispatch Amount', 'text', "When Dispatch set to 'No' this determines the value that will be pre-authenticated.<br />Whole amount if zero or not set.", $notebook_page, '');
add_config_field('payment.skypay.avscv2', 'AVSCV2 Check', 'select', "Perform checks on the Address and CVV number on the card.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.skypay.threeDSecure', '3D Secure Check', 'select', "Perform 3DSecure validation on the order if the cardholder is enrolled.<br />You must have this feature enabled on your account for it to work.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.skypay.formTemplate', 'Form Template', 'text', "Name of a customised payment template on the Skypay site, uses default if not set.<br />You will need to register to use this service.", $notebook_page, '');
add_config_field('payment.skypay.vendorEmail', 'Vendor Email', 'text', "Comma separated list of emails to receive payment success/failure emails.", $notebook_page, '');
add_config_field('payment.skypay.debug', 'Debug', 'select', "Logs debugging messages into a file (/plugins/payment/skypay/skypay_debug_log.php).<br />\n\t\t\t\tKeep it off unless you need to debug the payment process,<br />as it creates lots of output and the file could easily become unmanagable.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.skypay.title', 'Payment Method Title', 'text', "displayed on signup page and on renewal page", $notebook_page, '', '', '', array('default' => 'Skypay'));
add_config_field('payment.skypay.description', 'Payment Method Description', 'text', "displayed on signup page", $notebook_page, '', '', '', array('default' => 'Pay by credit/debit card'));
// we need an extra table for the payment stuff
include_once dirname(__FILE__) . '/skypay.php';
$skypay = new Skypay('');
$skypay->createTransactionTable();
示例#3
0
if ($payment['member_id'] != $vars['member_id']) {
    // payment doesn't match member
    fatal_error(_PLUG_PAY_CC_CORE_FERROR4);
}
if ($payment['completed']) {
    // paid already
    fatal_error(sprintf(_PLUG_PAY_CC_CORE_FERROR5, "<a href='{$config['root_url']}/member.php'>", "</a>"), 0);
}
if ($vars['register_transaction']) {
    // means we are back after the address form
    $errors = validateAddress($vars);
    if (!$errors) {
        // save billing address details within payment
        $payment_log = $db->get_payment($vars['payment_id']);
        $billingAddress = array();
        $fields = array('name_f', 'name_l', 'street', 'street2', 'city', 'zip', 'country');
        foreach ($fields as $v) {
            $billingAddress[$v] = $vars[$v];
        }
        $payment_log['data']['billing'] = $billingAddress;
        $db->update_payment($payment_log['payment_id'], $payment_log);
        $payment = $db->get_payment($vars['payment_id']);
        require_once dirname(__FILE__) . '/skypay.php';
        $skypay = new Skypay($config['payment']['skypay']);
        $skypay->hookPayment($payment);
    } else {
        getAddressDetails($member, $payment, $vars, $errors);
    }
} else {
    getAddressDetails($member, $payment, $vars);
}