コード例 #1
0
 public function __construct($options)
 {
     require_once 'php-merchant/gateways/paypal-digital-goods.php';
     $this->gateway = new PHP_Merchant_Paypal_Digital_Goods($options);
     // Now that the gateway is created, call parent constructor
     parent::__construct($options);
     $this->title = __('Paypal Digital Goods for Express Checkout', 'wpsc');
     $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')));
     add_action('wpsc_bottom_of_shopping_cart', array($this, 'add_iframe_script'));
     add_action('wpsc_confirm_checkout', array($this, 'remove_iframe_script'));
     add_filter('wpsc_purchase_log_gateway_data', array(get_parent_class($this), 'filter_purchase_log_gateway_data'), 10, 2);
 }
コード例 #2
0
 /**
  * Constructor of PayPal Express Checkout Gateway
  *
  * @param array $options
  * @return void
  *
  * @since 3.9
  */
 public function __construct($options)
 {
     require_once 'php-merchant/gateways/paypal-digital-goods.php';
     $this->gateway = new PHP_Merchant_Paypal_Digital_Goods($options);
     // Now that the gateway is created, call parent constructor
     parent::__construct($options);
     $this->title = __('PayPal ExpressCheckout for Digital Goods', 'wpsc');
     $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_cancel_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_action('wp_enqueue_scripts', array($this, 'dg_script'));
     add_filter('wpsc_purchase_log_gateway_data', array(get_parent_class($this), 'filter_purchase_log_gateway_data'), 10, 2);
     add_filter('wpsc_payment_method_form_fields', array($this, 'filter_unselect_default'), 100, 1);
 }
コード例 #3
0
 /**
  * Constructor of PayPal Express Checkout Gateway
  *
  * @param array $options
  *
  * @since 3.9
  */
 public function __construct($options)
 {
     require_once 'php-merchant/gateways/paypal-digital-goods.php';
     // Now that the gateway is created, call parent constructor
     parent::__construct($options, true);
     $this->gateway = new PHP_Merchant_Paypal_Digital_Goods($options);
     $this->title = __('PayPal Digital Goods for Express Checkout', '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_cancel_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 for DG Button
     add_action('wpsc_cart_item_table_form_actions_left', array($this, 'add_ecs_button'), 2, 2);
     // Filter Digital Goods option on checkout
     add_filter('wpsc_payment_method_form_fields', array(&$this, 'dg_option_removal'), 100);
 }