コード例 #1
0
ファイル: SimpleTest.php プロジェクト: chilloutalready/paypal
 /**
  * @covers OpenBuildings\PayPal\Payment_Adaptive_Simple::action_type
  */
 public function test_action_type()
 {
     $payment = Payment::instance('Adaptive_Simple');
     $this->assertEquals('PAY', $payment->action_type());
     $payment->action_type('CREATE');
     $this->assertEquals('CREATE', $payment->action_type());
 }
コード例 #2
0
ファイル: FieldsTest.php プロジェクト: chilloutalready/paypal
 public function setUp()
 {
     parent::setUp();
     $this->payment = Payment::instance('Adaptive_Simple');
     $this->payment->order(array('receiver' => array('email' => '*****@*****.**', 'amount' => 10)));
     $this->payment->config('fees_payer', Payment_Adaptive_Simple::FEES_PAYER_EACHRECEIVER)->config('email', '*****@*****.**');
 }
コード例 #3
0
 /**
  * @covers OpenBuildings\PayPal\Payment_Adaptive::common_fields
  */
 public function test_common_fields()
 {
     $this->assertSame(array('requestEnvelope.errorLanguage' => 'en_US', 'requestEnvelope.detailLevel' => 'ReturnAll'), Payment::instance('Adaptive_Simple')->common_fields());
 }
コード例 #4
0
 /**
  * @covers OpenBuildings\PayPal\Payment_ExpressCheckout::get_express_checkout_details
  */
 public function test_get_express_checkout_details_require_token()
 {
     $payment = Payment::instance('ExpressCheckout');
     $this->setExpectedException('OpenBuildings\\PayPal\\Exception', 'You must provide a TOKEN parameter for method "OpenBuildings\\PayPal\\Payment_ExpressCheckout::get_express_checkout_details"');
     $payment->get_express_checkout_details(array());
 }
コード例 #5
0
 public function test_instance_pattern()
 {
     $this->assertSame(Payment::instance('ExpressCheckout'), Payment::instance('ExpressCheckout'));
 }
コード例 #6
0
 /**
  * @dataProvider data_parse_response_exception
  * @covers OpenBuildings\PayPal\Payment::parse_response
  */
 public function test_parse_response_exception($response_string, $url, $request_data, $exception_message)
 {
     $this->setExpectedException('OpenBuildings\\PayPal\\Request_Exception', $exception_message);
     Payment::parse_response($response_string, $url, $request_data);
 }