Пример #1
0
 /**
  * Setup the Offline Payment module
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function __construct()
 {
     parent::__construct();
     // Reset the index count to shift setting indices so we don't break the JS environment
     if (isset($this->settings['label']) && is_array($this->settings['label'])) {
         $this->settings['label'] = array_merge(array(), $this->settings['label']);
     }
     if (isset($this->settings['instructions']) && is_array($this->settings['instructions'])) {
         $this->settings['instructions'] = array_merge(array(), $this->settings['instructions']);
     }
     // Scan and build a runtime index of active payment methods
     if (isset($this->settings['label']) && is_array($this->settings['label'])) {
         foreach ($this->settings['label'] as $i => $entry) {
             if (isset($this->settings['instructions']) && isset($this->settings['instructions'][$i])) {
                 $this->methods[$entry] = $this->settings['instructions'][$i];
             }
         }
     }
     add_filter('shopp_themeapi_checkout_offlineinstructions', array($this, 'instructions'), 10, 2);
     add_action('shopp_offlinepayment_sale', array($this, 'auth'));
     // Process sales as auth-only
     add_action('shopp_offlinepayment_auth', array($this, 'auth'));
     add_action('shopp_offlinepayment_capture', array($this, 'capture'));
     add_action('shopp_offlinepayment_refund', array($this, 'refund'));
     add_action('shopp_offlinepayment_void', array($this, 'void'));
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->setup('sid', 'verify', 'secret', 'testmode');
     add_filter('shopp_purchase_order_2checkout_processing', array($this, 'processing'));
     add_action('shopp_remote_payment', array($this, 'returned'));
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     $this->setup('account', 'pdtverify', 'pdttoken', 'testmode');
     if (!isset($this->settings['label'])) {
         $this->settings['label'] = 'PayPal';
     }
     add_filter('shopp_gateway_currency', array(__CLASS__, 'currencies'));
     add_filter('shopp_themeapi_cart_paypal', array($this, 'cartapi'));
     // add_filter('shopp_themeapi_cart_paypal', array($this, 'sendcart'), 10, 2); // provides shopp('cart.paypal') checkout button
     add_filter('shopp_checkout_submit_button', array($this, 'submit'), 10, 3);
     // replace submit button with paypal image
     // Prevent inclusive taxes from adding extra taxes to the order
     add_filter('shopp_gateway_tax_amount', array($this, 'notaxinclusive'));
     // request handlers
     add_action('shopp_remote_payment', array($this, 'pdt'));
     // process sync return from PayPal
     add_action('shopp_txn_update', array($this, 'ipn'));
     // process IPN
     // order event handlers
     add_filter('shopp_purchase_order_paypalstandard_processing', array($this, 'processing'));
     add_action('shopp_paypalstandard_sale', array($this, 'auth'));
     add_action('shopp_paypalstandard_auth', array($this, 'auth'));
     add_action('shopp_paypalstandard_capture', array($this, 'capture'));
     add_action('shopp_paypalstandard_refund', array($this, 'refund'));
     add_action('shopp_paypalstandard_void', array($this, 'void'));
 }
Пример #4
0
	/**
	 * Setup the TestMode gateway
	 *
	 * @since 1.1
	 *
	 * @return void Description...
	 **/
	function __construct () {
		parent::__construct();
		$this->setup('cards','error');

		// Autoset useable payment cards
		$this->settings['cards'] = array();
		foreach ($this->cards as $card)	$this->settings['cards'][] = $card->symbol;
	}
Пример #5
0
	function __construct () {
		parent::__construct();

		$this->setup('sid','verify','secret','returnurl','testmode');

		global $Ecart;
		$this->settings['returnurl'] = add_query_arg('rmtpay','process',ecarturl(false,'thanks',false));

		add_action('ecart_txn_update',array(&$this,'notifications'));
	}
Пример #6
0
 function __construct()
 {
     parent::__construct();
     load_paymill();
     // this function-call can and should be used whenever working with Paymill API
     $GLOBALS['paymill_loader']->paymill_errors->setFunction('paymill_shopp_errorHandling');
     if (!isset($this->settings['label'])) {
         $this->settings['label'] = 'Paymill';
     }
     add_action('shopp_paymillshopp_sale', array(&$this, 'sale'));
     // Process sales
     $GLOBALS['paymill_source']['shopp_version'] = SHOPP_VERSION;
 }
Пример #7
0
 function __construct()
 {
     parent::__construct();
     add_filter('shopp_checkout_submit_button', array(&$this, 'submit'), 10, 3);
     if (version_compare(SHOPP_VERSION, '1.1.9', '>')) {
         add_action('shopp_billmatecardpay_sale', array(&$this, 'auth'));
         // Process sales as auth-only
         add_action('shopp_billmatecardpay_auth', array(&$this, 'auth'));
         add_action('shopp_billmatecardpay_capture', array(&$this, 'capture'));
         add_action('shopp_billmatecardpay_refund', array(&$this, 'refund'));
         add_action('shopp_billmatecardpay_void', array(&$this, 'void'));
     }
     add_action('shopp_order_success', array(&$this, 'success'));
 }
Пример #8
0
 /**
  * Setup the TestMode gateway
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function __construct()
 {
     parent::__construct();
     $this->setup('cards', 'error');
     // Autoset useable payment cards
     $this->settings['cards'] = array();
     foreach ($this->cards as $card) {
         $this->settings['cards'][] = $card->symbol;
     }
     add_action('shopp_testmode_sale', array($this, 'sale'));
     add_action('shopp_testmode_auth', array($this, 'auth'));
     add_action('shopp_testmode_capture', array($this, 'capture'));
     add_action('shopp_testmode_refund', array($this, 'refund'));
     add_action('shopp_testmode_void', array($this, 'void'));
 }
Пример #9
0
 function __construct()
 {
     parent::__construct();
     add_filter('shopp_checkout_submit_button', array(&$this, 'submit'), 10, 3);
     if (version_compare(SHOPP_VERSION, '1.1.9', '>')) {
         add_action('shopp_billmateinvoice_sale', array(&$this, 'auth'));
         // Process sales as auth-only
         add_action('shopp_billmateinvoice_auth', array(&$this, 'auth'));
         add_action('shopp_billmateinvoice_capture', array(&$this, 'capture'));
         add_action('shopp_billmateinvoice_refund', array(&$this, 'refund'));
         add_action('shopp_billmateinvoice_void', array(&$this, 'void'));
     }
     add_action('wp_head', array(&$this, 'billmate_load_styles'), 6);
     add_action('wp_enqueue_scripts', array(&$this, 'billmate_load_scripts'), 6);
     add_action('shopp_order_success', array(&$this, 'success'));
 }
Пример #10
0
	function __construct () {
		parent::__construct();

		global $Ecart;

		$this->urls['schema'] = 'http://checkout.google.com/schema/2';

		$this->urls['checkout'] = array(
			'live' => 'https://%s:%s@checkout.google.com/api/checkout/v2/merchantCheckout/Merchant/%s',
			'test' => 'https://%s:%s@sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/%s'
			);

		$this->urls['order'] = array(
			'live' => 'https://%s:%s@checkout.google.com/api/checkout/v2/request/Merchant/%s',
			'test' => 'https://%s:%s@sandbox.google.com/checkout/api/checkout/v2/request/Merchant/%s'
			);

		$this->urls['button'] = array(
			'live' => (is_ecart_secure()?'https':'http').'://checkout.google.com/buttons/checkout.gif',
			'test' => (is_ecart_secure()?'https':'http').'://sandbox.google.com/checkout/buttons/checkout.gif'
			);

		$this->merchant_calc_url = esc_url(add_query_string('_txnupdate=gc',ecarturl(false,'catalog',true)));

		$this->setup('id','key','apiurl');
		$this->settings['merchant_email'] = $Ecart->Settings->get('merchant_email');
		$this->settings['location'] = "en_US";
		$base = $Ecart->Settings->get('base_operations');
		if ($base['country'] == "GB") $this->settings['location'] = "en_UK";

		$this->settings['base_operations'] = $Ecart->Settings->get('base_operations');
		$this->settings['currency'] = $this->settings['base_operations']['currency']['code'];
		if (empty($this->settings['currency'])) $this->settings['currency'] = "USD";

		$this->settings['taxes'] = $Ecart->Settings->get('taxrates');

		if (isset($_GET['gctest'])) $this->order('');

		add_action('ecart_txn_update',array(&$this,'notifications'));
		add_filter('ecart_checkout_submit_button',array(&$this,'submit'),10,3);
		add_action('get_header',array(&$this,'analytics'));
		add_filter('ecart_tag_cart_google',array($this,'cartcheckout'));
		add_action('parse_request',array(&$this,'intercept_cartcheckout'));

	}
Пример #11
0
	/**
	 * Setup the Offline Payment module
	 *
	 * @since 1.1
	 *
	 * @return void Description...
	 **/
	function __construct () {
		parent::__construct();
		$this->setup('instructions');

		// Reset the index count to shift setting indices so we don't break the JS environment
		if (isset($this->settings['label']) && is_array($this->settings['label']))
			$this->settings['label'] = array_merge(array(),$this->settings['label']);
		if (isset($this->settings['instructions']) && is_array($this->settings['instructions']))
		$this->settings['instructions'] = array_merge(array(),$this->settings['instructions']);

		// Scan and build a runtime index of active payment methods
		if (isset($this->settings['label']) && is_array($this->settings['label'])) {
			foreach ($this->settings['label'] as $i => $entry)
				if (isset($this->settings['instructions']) && isset($this->settings['instructions'][$i]))
					$this->methods[$entry] = $this->settings['instructions'][$i];
		}

		add_filter('ecart_tag_checkout_offline-instructions',array(&$this,'tag_instructions'),10,2);
		add_filter('ecart_payment_methods',array(&$this,'methods'));
	}
Пример #12
0
 /**
  * Constructs and initialize an iDEAL gateway module
  */
 public function __construct()
 {
     parent::__construct();
     // Setup
     $this->setup('config_id');
     // Config ID
     $this->config_id = $this->settings['config_id'];
     // Order processing
     //add_filter('shopp_purchase_order_processing', array($this, 'orderProcessing'), 20, 2);
     // Checkout gateway inputs
     add_filter('shopp_checkout_gateway_inputs', array($this, 'inputs'), 50);
     // Actions
     // @see /shopp/core/model/Gateway.php#L122
     $name = sanitize_key(__CLASS__);
     add_action('shopp_' . $name . '_sale', array($this, 'sale'));
     add_action('shopp_' . $name . '_auth', array($this, 'auth'));
     add_action('shopp_' . $name . '_capture', array($this, 'capture'));
     add_action('shopp_' . $name . '_refund', array($this, 'refund'));
     add_action('shopp_' . $name . '_void', array($this, 'void'));
 }
Пример #13
0
	function __construct () {
		parent::__construct();

		$this->setup('account','pdtverify','pdttoken','testmode');

		$this->settings['currency_code'] = $this->currencies[0];
		if (in_array($this->baseop['currency']['code'],$this->currencies))
			$this->settings['currency_code'] = $this->baseop['currency']['code'];

		if (array_key_exists($this->baseop['country'],$this->locales))
			$this->settings['locale'] = $this->locales[$this->baseop['country']];
		else $this->settings['locale'] = $this->locales['US'];

		$this->buttonurl = sprintf(force_ssl($this->buttonurl), $this->settings['locale']);

		if (!isset($this->settings['label'])) $this->settings['label'] = "PayPal";

		add_action('ecart_txn_update',array(&$this,'updates'));
		add_filter('ecart_tag_cart_paypal',array(&$this,'sendcart'),10,2);
		add_filter('ecart_checkout_submit_button',array(&$this,'submit'),10,3);
	}
Пример #14
0
	function __construct () {
		parent::__construct();

		$this->setup('username','password','signature','testmode');

		$this->settings['currency_code'] = $this->currencies[0];
		if (in_array($this->baseop['currency']['code'],$this->currencies))
			$this->settings['currency_code'] = $this->baseop['currency']['code'];

		if (array_key_exists($this->baseop['country'],$this->locales))
			$this->settings['locale'] = $this->locales[$this->baseop['country']];
		else $this->settings['locale'] = $this->locales['US'];

		$this->buttonurl = sprintf(force_ssl($this->buttonurl), $this->settings['locale']);
		$this->sandboxurl = sprintf($this->sandboxurl, $this->settings['locale']);
		$this->liveurl = sprintf($this->liveurl, $this->settings['locale']);

		if (!isset($this->settings['label'])) $this->settings['label'] = "PayPal";

		add_action('ecart_txn_update',array(&$this,'updates'));
		add_filter('ecart_tag_cart_paypal-express',array(&$this,'cartcheckout'),10,2);
		add_filter('ecart_checkout_submit_button',array(&$this,'submit'),10,3);

	}
Пример #15
0
 /**
  * Setup the ShoppFreeOrder gateway
  *
  * @author Jonathan Davis
  * @since 1.2
  *
  * @return void
  **/
 public function __construct()
 {
     parent::__construct();
     $this->name = __('Free Order', 'Shopp');
     add_action('shopp_freeorder_sale', array($this, 'capture'));
     add_action('shopp_freeorder_refund', array($this, 'void'));
     add_action('shopp_freeorder_void', array($this, 'void'));
 }
Пример #16
0
	function AuthorizeNet () {
		parent::__construct();
		$this->setup('login','password','testmode');
	}