function __construct($purchase_id = null, $is_receiving = false)
 {
     $this->name = __('Test Gateway', 'wpsc');
     parent::__construct($purchase_id, $is_receiving);
     add_filter('wpsc_purchase_log_customer_notification_raw_message', array($this, '_filter_customer_notification_raw_message'), 10, 2);
     add_filter('wpsc_purchase_log_customer_html_notification_raw_message', array($this, '_filter_customer_notification_raw_message'), 10, 2);
 }
 function __construct($purchase_id = null, $is_receiving = false)
 {
     $this->name = __('PayPal Pro 2.0', 'wpsc');
     parent::__construct($purchase_id, $is_receiving);
 }
 /**
  * Construct and initialize an Pronamic iDEAL merchant class
  */
 public function __construct($purchase_id = null, $is_receiving = false)
 {
     parent::__construct($purchase_id, $is_receiving);
     $this->name = __('Pronamic iDEAL', 'pronamic_ideal');
 }
Beispiel #4
0
/**
 * Handle Response from DIBS server
 * 
 * 
 *  
 */
function dibspayment_paywin_process()
{
    global $wpdb;
    if (isset($_GET['dibspw_result']) && isset($_POST['s_pid'])) {
        array_walk($_POST, create_function('&$val', '$val = stripslashes($val);'));
        $hamc_key = get_option('dibspw_hmac');
        $order_id = $_POST['orderid'];
        switch ($_GET['dibspw_result']) {
            case 'callback':
                if ($hamc_key && !isset($_POST['MAC'])) {
                    die("HMAC error!");
                }
                if (isset($_POST['MAC']) && $_POST['MAC'] != dibspayment_paywin_calc_mac($_POST, $hamc_key, $bUrlDecode = FALSE)) {
                    die("Mac is incorrect, fraud attempt!!");
                }
                $dibsInvoiceFields = array("acquirerLastName", "acquirerFirstName", "acquirerDeliveryAddress", "acquirerDeliveryPostalCode", "acquirerDeliveryPostalPlace");
                $dibsInvoiceFieldsString = "";
                foreach ($_POST as $key => $value) {
                    if (in_array($key, $dibsInvoiceFields)) {
                        $dibsInvoiceFieldsString .= "{$key}={$value}\n";
                    }
                }
                // Email is not send automatically on a success transactio page
                // from version '3.8.9 so we send email on callback from this version
                if (version_compare(get_option('wpsc_version'), '3.8.9', '>=')) {
                    if ($_POST['status'] == "ACCEPTED") {
                        $purchaselog = new WPSC_Purchase_Log($order_id);
                        $purchaselog->set('processed', get_option('dibspw_status'));
                        $purchaselog->set('notes', $dibsInvoiceFieldsString);
                        $purchaselog->save();
                        $wpscmerch = new wpsc_merchant($order_id, false);
                        $wpscmerch->set_purchase_processed_by_purchid(get_option('dibspw_status'));
                    }
                } else {
                    if ($_POST['status'] == "ACCEPTED") {
                        $purchase_log = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $_POST['s_pid'] . " LIMIT 1", ARRAY_A);
                        $wpdb->query("UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET `processed` = '" . get_option('dibspw_status') . "', `notes`='" . $dibsInvoiceFieldsString . "'  WHERE `id` = '" . $purchase_log[0]['id'] . "' LIMIT 1;");
                        // If it is the second callback with status ACCEPTED
                        // we want to send an email to customer.
                        if ($purchase_log[0]['authcode'] == "PENDING") {
                            transaction_results($_POST['s_pid'], false);
                        }
                    } else {
                        // we save not successed statuses it can be PENDING status..
                        $wpdb->query("UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET `processed` = '1' , `authcode` = '" . $_POST['status'] . "'  WHERE `id` = '" . $purchase_log[0]['id'] . "' LIMIT 1;");
                    }
                }
                break;
            case 'success':
                if (!isset($_GET['page_id']) || get_permalink($_GET['page_id']) != get_option('transact_url')) {
                    $location = add_query_arg('sessionid', $_POST['s_pid'], get_option('transact_url'));
                    if ($_POST['status'] == "ACCEPTED") {
                        if ($hamc_key && !isset($_POST['MAC'])) {
                            die("HMAC error!");
                        }
                        if (isset($_POST['MAC']) && $_POST['MAC'] != dibspayment_paywin_calc_mac($_POST, $hamc_key, $bUrlDecode = FALSE)) {
                            die("HMAC is incorrect, fraud attempt!");
                        }
                    } else {
                        // Declined or PENDING
                        $purchase_log = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $_POST['s_pid'] . " LIMIT 1", ARRAY_A);
                        $wpdb->query("UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET `processed` = '1' , `authcode` = '" . $_POST['status'] . "'  WHERE `id` = '" . $purchase_log[0]['id'] . "' LIMIT 1;");
                    }
                    wp_redirect($location);
                    exit;
                }
                break;
            case 'cancel':
                if (isset($_POST['orderid'])) {
                    $purchase_log = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $_POST['s_pid'] . " LIMIT 1", ARRAY_A);
                    $wpdb->query("UPDATE `" . WPSC_TABLE_PURCHASE_LOGS . "` SET `processed` = '" . get_option('dibspw_statusc') . "' WHERE `id` = '" . $purchase_log[0]['id'] . "' LIMIT 1;");
                    wp_redirect(get_option('shopping_cart_url'));
                    exit;
                }
                break;
        }
    }
}
 function __construct($purchase_id = null, $is_receiving = false)
 {
     $this->name = __('PayPal Payments Standard', 'wp-e-commerce');
     parent::__construct($purchase_id, $is_receiving);
 }
 function __construct($purchase_id = null, $is_receiving = false)
 {
     $this->name = __('Test Gateway', 'wpsc');
     parent::__construct($purchase_id, $is_receiving);
 }
 /**
  * Construct
  */
 function __construct($purchase_id = NULL, $is_receiving = false, $prefs = NULL, $mycred = NULL, $type = 'mycred_default')
 {
     parent::__construct($purchase_id, $is_receiving);
     $this->prefs = $prefs;
     $this->core = $mycred;
     $this->mycred_type = $type;
 }
Beispiel #8
0
 public function __construct($purchase_id = null, $is_receiving = false)
 {
     if (get_option('permalink_structure') != '') {
         $this->separator = "?";
     } else {
         $this->separator = "&";
     }
     $this->sagepay_options = get_option('wpec_sagepay');
     $this->sagepay_options['seperator'] = $this->separator;
     wpsc_merchant::__construct($purchase_id, $is_receiving);
 }
 function __construct($purchase_id = null, $is_receiving = false)
 {
     $this->name = 'oklink';
     parent::__construct($purchase_id, $is_receiving);
 }
Beispiel #10
0
 public function __construct($purchase_id = null, $is_receiving = false)
 {
     wpsc_merchant::__construct($purchase_id, $is_receiving);
     $this->options = get_option('wpec_pxfusion');
 }