public function test_successful_set_express_checkout_request()
 {
     global $test_accounts;
     $gateway = new PHP_Merchant_Paypal_Express_Checkout($test_accounts['paypal-express-checkout']);
     $purchase_options = array('return_url' => 'http://example.com/return', 'cancel_url' => 'http://example.com/cancel', 'address_override' => true, 'shipping_address' => array('name' => 'Gary Cao', 'street' => '1 Infinite Loop', 'street2' => 'Apple Headquarter', 'city' => 'Cupertino', 'state' => 'CA', 'country' => 'US', 'zip' => '95014', 'phone' => '(877) 412-7753'), 'currency' => 'JPY', 'subtotal' => 13700, 'shipping' => 1500, 'tax' => 137, 'description' => 'Order for example.com', 'invoice' => 'E84A90G94', 'notify_url' => 'http://example.com/ipn', 'items' => array(array('name' => 'Gold Cart Plugin', 'description' => 'Gold Cart extends your WP e-Commerce store by enabling additional features and functionality.', 'amount' => 4000, 'quantity' => 1, 'tax' => 40, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/gold-cart-plugin/'), array('name' => 'Member Access Plugin', 'description' => 'Create pay to view subscription sites', 'amount' => 5000, 'quantity' => 1, 'tax' => 50, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/member-access-plugin/'), array('name' => 'Amazon S3', 'description' => 'This Plugin allows downloadable products on your WP e-Commerce site to be hosted on Amazon S3.', 'amount' => 4700, 'quantity' => 1, 'tax' => 47, 'url' => 'http://getshopped.org/extend/premium-upgrades/premium-upgrades/amazon-s3-plugin/')));
     $this->response = $response = $gateway->setup_purchase(15337, $purchase_options);
     $this->token = $response->get('token');
     $this->timestamp = $response->get('timestamp');
     $this->datetime = $response->get('datetime');
     $this->correlation_id = $response->get('correlation_id');
     $this->version = $response->get('version');
     $this->build = $response->get('build');
     $this->assertTrue($response->is_successful());
     $this->assertFalse($response->has_errors());
 }
Пример #2
0
 /**
  * For Digital Goods purchases, PayPal requires the PAYMENTREQUEST_n_ITEMAMT. This function sets the 'items' flag to required
  * then calls @see parent::setup_purchase() to initiate an Express Checkout payment.
  *
  * @uses self::requires() to flag 'items' as required
  * @uses parent::setup_purchase() to create and make the request.
  * @return PHP_Merchant_Paypal_Express_Checkout_Response An object containing the details of PayPal's response to the request.
  */
 public function setup_purchase($options = array(), $action = 'Sale')
 {
     $options['no_shipping'] = true;
     return parent::setup_purchase($options, $action);
 }
 /**
  * For Digital Goods purchases, PayPal requires the PAYMENTREQUEST_n_ITEMAMT. This function sets the 'items' flag to required
  * then calls @see parent::setup_purchase() to initiate an Express Checkout payment. 
  * 
  * @uses self::requires() to flag 'items' as required
  * @uses parent::setup_purchase() to create and make the request.
  * @return PHP_Merchant_Paypal_Express_Checkout_Response An object containing the details of PayPal's response to the request. 
  */
 public function setup_purchase($options = array(), $action = 'Sale')
 {
     return parent::setup_purchase($options, $action);
 }
Пример #4
0
 /**
  * For Digital Goods purchases, PayPal requires the PAYMENTREQUEST_n_ITEMAMT. This function sets the 'items' flag to required
  * then calls @see parent::setup_purchase() to initiate an Express Checkout payment. 
  * 
  * @uses self::requires() to flag 'items' as required
  * @uses parent::setup_purchase() to create and make the request.
  * @return PHP_Merchant_Paypal_Express_Checkout_Response An object containing the details of PayPal's response to the request. 
  */
 public function setup_purchase($options = array())
 {
     return parent::setup_purchase($options);
 }