Skip to content

Commit c7ab64c

Browse files
committed
added support for reference transaction in expres checkout
1 parent e3ac617 commit c7ab64c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Support/InstantUpdateApi/BillingAgreement.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
namespace Omnipay\PayPal\Support\InstantUpdateApi;
44

5+
use Omnipay\Common\Exception\InvalidRequestException;
6+
57
class BillingAgreement
68
{
79
/**
810
* Billing agreement types for single or recurring payment
911
*
1012
* @var array
1113
*/
12-
protected $types = [
14+
protected $types = array(
1315
'single' => 'MerchantInitiatedBillingSingleAgreement',
1416
'recurring' => 'MerchantInitiatedBilling',
15-
];
17+
);
1618

1719
/** @var string */
1820
private $type;

tests/Message/ExpressAuthorizeRequestTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function testGetDataWithRecurringBillingAgreement()
397397

398398
public function testGetDataWithBillingAgreementOptionalParameters()
399399
{
400-
$billingAgreement = new BillingAgreement(true, 'Some Stuff', 'InstantOnly ', 'Some custom annotation');
400+
$billingAgreement = new BillingAgreement(true, 'Some Stuff', 'InstantOnly', 'Some custom annotation');
401401
$this->request->setBillingAgreement($billingAgreement);
402402

403403
$data = $this->request->getData();
@@ -408,13 +408,16 @@ public function testGetDataWithBillingAgreementOptionalParameters()
408408
$this->assertSame('Some custom annotation', $data['L_BILLINGAGREEMENTCUSTOM0']);
409409
}
410410

411+
/**
412+
*
413+
*/
411414
public function testGetDataWithBillingAgreementWrongPaymentType()
412415
{
413-
$billingAgreement = new BillingAgreement(true, 'Some Stuff', 'BadType ', 'Some custom annotation');
414-
415416
$this->setExpectedException(
416417
'\Omnipay\Common\Exception\InvalidRequestException',
417418
"The 'paymentType' parameter can be only 'Any' or 'InstantOnly'"
418419
);
420+
421+
$billingAgreement = new BillingAgreement(false, 'Some Stuff', 'BadType', 'Some custom annotation');
419422
}
420423
}

0 commit comments

Comments
 (0)