Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $this->title = __('Amazon Payments', 'wpsc');
     $this->reference_id = !empty($_REQUEST['amazon_reference_id']) ? sanitize_text_field($_REQUEST['amazon_reference_id']) : '';
     $this->user_is_authenticated = isset($_GET['amazon_payments_advanced']) && 'true' == $_GET['amazon_payments_advanced'] && isset($_GET['access_token']);
     $this->order_handler = WPSC_Amazon_Payments_Order_Handler::get_instance($this);
     add_action('init', array($this->order_handler, 'process_ipn'));
     // Define user set variables
     $this->seller_id = $this->setting->get('seller_id');
     $this->mws_access_key = $this->setting->get('mws_access_key');
     $this->secret_key = $this->setting->get('secret_key');
     $this->sandbox = $this->setting->get('sandbox_mode') == '1' ? true : false;
     $this->payment_capture = $this->setting->get('payment_capture') !== null ? $this->setting->get('payment_capture') : '';
     $this->client_id = $this->setting->get('client_id');
     $base_country = new WPSC_Country(wpsc_get_base_country());
     // Get endpoint
     $location = in_array($base_country->get_isocode(), array('US', 'GB', 'DE', 'JP')) ? $base_country->get_isocode() : 'US';
     $this->endpoint = $this->sandbox ? $this->endpoints['sandbox'][$location] : $this->endpoints['production'][$location];
     $this->define_widget_constants();
     if (isset($_POST['post_data'])) {
         parse_str($_POST['post_data'], $post_data);
         if (isset($post_data['amazon_reference_id'])) {
             $this->reference_id = sanitize_text_field($post_data['amazon_reference_id']);
         }
     }
 }
Пример #2
0
 /**
  * Constructor of PayPal Pro Gateway
  *
  * @param array $options
  * @return void
  *
  * @since 3.9
  */
 public function __construct($options)
 {
     parent::__construct();
     $this->title = __('PayPal Pro Hosted', 'wp-e-commerce');
     require_once 'php-merchant/gateways/paypal-pro.php';
     $this->gateway = new PHP_Merchant_Paypal_Pro($options);
     $this->gateway->set_options(array('api_username' => $this->setting->get('api_username'), 'api_password' => $this->setting->get('api_password'), 'api_signature' => $this->setting->get('api_signature'), 'cancel_url' => $this->get_shopping_cart_payment_url(), 'currency' => $this->get_currency_code(), 'test' => (bool) $this->setting->get('sandbox_mode')));
 }
 public function __construct()
 {
     parent::__construct();
     $this->title = __('Paypal Express Checkout 3.0', 'wpsc');
     require_once 'php-merchant/gateways/paypal-express-checkout.php';
     $this->gateway = new PHP_Merchant_Paypal_Express_Checkout();
     $this->gateway->set_options(array('api_username' => $this->setting->get('api_username'), 'api_password' => $this->setting->get('api_password'), 'api_signature' => $this->setting->get('api_signature'), 'cancel_url' => get_option('shopping_cart_url'), 'currency' => $this->get_currency_code(), 'test' => (bool) $this->setting->get('sandbox_mode'), 'address_override' => true));
     add_filter('wpsc_purchase_log_gateway_data', array($this, 'filter_purchase_log_gateway_data'), 10, 2);
 }
 /**
  * Constructor of PayPal Express Checkout Gateway
  *
  * @param array $options
  * @return void
  *
  * @since 3.9
  */
 public function __construct($options)
 {
     parent::__construct();
     $this->title = __('PayPal Express Checkout 3.0', 'wpsc');
     require_once 'php-merchant/gateways/paypal-express-checkout.php';
     $this->gateway = new PHP_Merchant_Paypal_Express_Checkout($options);
     $this->gateway->set_options(array('api_username' => $this->setting->get('api_username'), 'api_password' => $this->setting->get('api_password'), 'api_signature' => $this->setting->get('api_signature'), 'cancel_url' => $this->get_shopping_cart_payment_url(), 'currency' => $this->get_currency_code(), 'test' => (bool) $this->setting->get('sandbox_mode'), 'address_override' => 1, 'solution_type' => 'mark', 'cart_logo' => $this->setting->get('cart_logo'), 'cart_border' => $this->setting->get('cart_border')));
     add_filter('wpsc_purchase_log_gateway_data', array($this, 'filter_purchase_log_gateway_data'), 10, 2);
     add_filter('wpsc_payment_method_form_fields', array($this, 'filter_unselect_default'), 100, 1);
 }
 /**
  * Constructor
  *
  * @access public
  */
 public function __construct($options)
 {
     parent::__construct();
     $this->title = __('Credit Card', PBCI_AUTHNET);
     //add_action( 'wpsc_before_shipping_of_shopping_cart', array( &$this, 'checkout_form' ) );
     add_filter('wpsc_gateway_checkout_form_' . $this->gateway_name(), array(&$this, 'gateway_checkout_form_filter'), 10, 1);
     if (defined('AUTHORIZENET_API_LOGIN_ID')) {
         $this->api_login_id = AUTHORIZENET_API_LOGIN_ID;
         $this->api_login_id_can_change = false;
     } else {
         $this->api_login_id = $this->setting->get('api_login_id');
         $this->api_login_id_can_change = true;
     }
     if (defined('AUTHORIZENET_TRANSACTION_KEY')) {
         $this->api_transaction_key = AUTHORIZENET_TRANSACTION_KEY;
         $this->api_transaction_key_can_change = false;
     } else {
         $this->api_transaction_key = $this->setting->get('api_transaction_key');
         $this->api_transaction_key_can_change = true;
     }
     if (defined('AUTHORIZENET_SANDBOX')) {
         $this->sandbox_mode = (bool) AUTHORIZENET_SANDBOX;
         $this->sandbox_mode_can_change = false;
     } else {
         $this->sandbox_mode = (bool) $this->setting->get('sandbox_mode');
         $this->sandbox_mode_can_change = true;
     }
     if (isset($_REQUEST['auth_net'])) {
         $card_data = $_REQUEST['auth_net'];
         if (empty($card_data['card_number'])) {
             $card_data['card_number'] = '';
         }
         if (empty($card_data['expiry']['month'])) {
             $card_data['expiry']['month'] = '00';
         }
         if (empty($card_data['expiry']['year'])) {
             $card_data['expiry']['year'] = '00';
         }
         if (empty($card_data['card_code'])) {
             $card_data['card_code'] = '';
         }
         if (isset($card_data['card_number'])) {
             $this->card_number = $this->digits_and_spaces_only($card_data['card_number']);
         }
         if (isset($card_data['expiry']['month'])) {
             $this->expiration_month = $this->digits_and_spaces_only($card_data['expiry']['month']);
         }
         if (isset($card_data['expiry']['year'])) {
             $this->expiration_year = $this->digits_and_spaces_only($card_data['expiry']['year']);
         }
         if (isset($card_data['card_code'])) {
             $this->card_verification_code = $this->digits_and_spaces_only($card_data['card_code']);
         }
     }
 }
 /**
  * Constructor of PayPal Express Checkout Gateway.
  * The $child parameter should be set to true, if the constructor
  * is called from a child class.
  *
  * @param array $options
  * @param bool $child
  *
  * @since 3.9
  */
 public function __construct($options, $child = false)
 {
     parent::__construct();
     require_once 'php-merchant/gateways/paypal-express-checkout.php';
     $this->gateway = new PHP_Merchant_Paypal_Express_Checkout($options);
     if (!$child) {
         $this->title = __('PayPal Express Checkout 3.0', 'wp-e-commerce');
         $this->gateway->set_options(array('api_username' => $this->setting->get('api_username'), 'api_password' => $this->setting->get('api_password'), 'api_signature' => $this->setting->get('api_signature'), 'cancel_url' => $this->get_shopping_cart_payment_url(), 'currency' => $this->get_currency_code(), 'test' => (bool) $this->setting->get('sandbox_mode'), 'address_override' => 1, 'solution_type' => 'mark', 'cart_logo' => $this->setting->get('cart_logo'), 'cart_border' => $this->setting->get('cart_border')));
         // Express Checkout Button
         add_action('wpsc_cart_item_table_form_actions_left', array($this, 'add_ecs_button'), 2, 2);
     }
 }
 /**
  * Constructor of PayPal Pro Gateway
  *
  * @param array $options
  * @return void
  *
  * @since 3.9
  */
 public function __construct($options)
 {
     parent::__construct();
     $this->title = __('PayPal Pro Hosted', 'wpsc');
     require_once 'php-merchant/gateways/paypal-pro.php';
     $this->gateway = new PHP_Merchant_Paypal_Pro($options);
     $this->gateway->set_options(array('api_username' => $this->setting->get('api_username'), 'api_password' => $this->setting->get('api_password'), 'api_signature' => $this->setting->get('api_signature'), 'cancel_url' => $this->get_shopping_cart_payment_url(), 'currency' => $this->get_currency_code(), 'test' => (bool) $this->setting->get('sandbox_mode')));
     // Load PayPal Pro JavaScript file
     add_action('wp_enqueue_scripts', array($this, 'pro_script'));
     add_filter('wpsc_purchase_log_gateway_data', array($this, 'filter_purchase_log_gateway_data'), 10, 2);
     // Unselect Default Payment Gateway
     add_filter('wpsc_payment_method_form_fields', array($this, 'filter_unselect_default'), 101, 1);
 }
Пример #8
0
 /**
  * Constructor of WorldPay Payment Gateway
  *
  * @access public
  * @since 3.9
  */
 public function __construct()
 {
     parent::__construct();
     $this->title = __('WorldPay Payment Gateway', 'wp-e-commerce');
     $this->supports = array('default_credit_card_form', 'tev1');
     $this->order_handler = WPSC_WorldPay_Payments_Order_Handler::get_instance($this);
     // Define user set variables
     $this->secure_net_id = $this->setting->get('secure_net_id');
     $this->secure_key = $this->setting->get('secure_key');
     $this->public_key = $this->setting->get('public_key');
     $this->sandbox = $this->setting->get('sandbox_mode') == '1' ? true : false;
     $this->endpoint = $this->sandbox ? $this->endpoints['sandbox'] : $this->endpoints['production'];
     $this->payment_capture = $this->setting->get('payment_capture') !== null ? $this->setting->get('payment_capture') : '';
     $this->auth = 'Basic ' . base64_encode($this->setting->get('secure_net_id') . ':' . $this->setting->get('secure_key'));
 }
Пример #9
0
 /**
  * Constructor of Manual Payment Gateway
  *
  * @access public
  * @since 3.9
  */
 public function __construct()
 {
     parent::__construct();
     $this->title = __('Manual Payment Gateway 3.0', 'wpsc');
 }