diff --git a/src/SubscribePro/Service/Address/Address.php b/src/SubscribePro/Service/Address/Address.php index 0b4c341..e1f34c3 100644 --- a/src/SubscribePro/Service/Address/Address.php +++ b/src/SubscribePro/Service/Address/Address.php @@ -22,6 +22,7 @@ class Address extends DataObject implements AddressInterface self::COMPANY => false, self::STREET1 => false, self::STREET2 => false, + self::STREET3 => false, self::CITY => false, self::REGION => false, self::POSTCODE => false, @@ -39,6 +40,7 @@ class Address extends DataObject implements AddressInterface self::COMPANY => false, self::STREET1 => false, self::STREET2 => false, + self::STREET3 => false, self::CITY => false, self::REGION => false, self::POSTCODE => false, @@ -56,6 +58,7 @@ class Address extends DataObject implements AddressInterface self::COMPANY => false, self::STREET1 => false, self::STREET2 => false, + self::STREET3 => false, self::CITY => false, self::REGION => false, self::POSTCODE => false, @@ -245,6 +248,23 @@ public function setStreet2($street2) return $this->setData(self::STREET2, $street2); } + /** + * @return string|null + */ + public function getStreet3() + { + return $this->getData(self::STREET3); + } + + /** + * @param string|null $street3 + * @return $this + */ + public function setStreet3($street3) + { + return $this->setData(self::STREET3, $street3); + } + /** * @return string|null */ diff --git a/src/SubscribePro/Service/Address/AddressInterface.php b/src/SubscribePro/Service/Address/AddressInterface.php index 24a424a..b2eb95a 100644 --- a/src/SubscribePro/Service/Address/AddressInterface.php +++ b/src/SubscribePro/Service/Address/AddressInterface.php @@ -18,6 +18,7 @@ interface AddressInterface extends DataInterface const COMPANY = 'company'; const STREET1 = 'street1'; const STREET2 = 'street2'; + const STREET3 = 'street3'; const CITY = 'city'; const REGION = 'region'; const POSTCODE = 'postcode'; @@ -132,6 +133,17 @@ public function getStreet2(); */ public function setStreet2($street2); + /** + * @return string|null + */ + public function getStreet3(); + + /** + * @param string|null $street3 + * @return $this + */ + public function setStreet3($street3); + /** * @return string|null */ diff --git a/tests/Service/Address/AddressTest.php b/tests/Service/Address/AddressTest.php index 9e143a0..841aa58 100644 --- a/tests/Service/Address/AddressTest.php +++ b/tests/Service/Address/AddressTest.php @@ -49,6 +49,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ AddressInterface::CITY => 'city', @@ -62,6 +63,7 @@ public function getFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], ], 'Not new address' => [ @@ -81,6 +83,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ AddressInterface::CITY => 'city', @@ -94,6 +97,7 @@ public function getFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], ], ]; @@ -117,8 +121,9 @@ public function testGetAsChildFormData($data) AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ]; - + $this->address->importData($data); $this->assertEquals($expectedData, $this->address->getFormData()); } @@ -144,6 +149,7 @@ public function getAsChildFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], ], 'Not new address' => [ @@ -163,6 +169,7 @@ public function getAsChildFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], ], ]; diff --git a/tests/Service/PaymentProfile/PaymentProfileTest.php b/tests/Service/PaymentProfile/PaymentProfileTest.php index 0680bbd..f0c1d38 100644 --- a/tests/Service/PaymentProfile/PaymentProfileTest.php +++ b/tests/Service/PaymentProfile/PaymentProfileTest.php @@ -231,6 +231,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingData' => [ @@ -247,6 +248,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ PaymentProfileInterface::CUSTOMER_ID => '123', @@ -302,6 +304,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingData' => [ @@ -318,6 +321,7 @@ public function getFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ PaymentProfileInterface::CREDITCARD_MONTH => '04', @@ -334,6 +338,7 @@ public function getFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingFormData' => [ @@ -347,7 +352,8 @@ public function getFormDataProvider() AddressInterface::POSTCODE => 'postcode', AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', - AddressInterface::STREET2 => 'street2' + AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], ]; @@ -454,6 +460,7 @@ public function getTokenFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingData' => [ @@ -470,6 +477,7 @@ public function getTokenFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ PaymentProfileInterface::CUSTOMER_ID => '123', @@ -488,6 +496,7 @@ public function getTokenFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingFormData' => [ @@ -502,6 +511,7 @@ public function getTokenFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], ]; @@ -638,6 +648,7 @@ public function getThirdPartyTokenFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingData' => [ @@ -654,6 +665,7 @@ public function getThirdPartyTokenFormDataProvider() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], 'expectedData' => [ PaymentProfileInterface::CUSTOMER_ID => '123', @@ -676,6 +688,7 @@ public function getThirdPartyTokenFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], 'billingFormData' => [ @@ -690,6 +703,7 @@ public function getThirdPartyTokenFormDataProvider() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ] ], ]; diff --git a/tests/Service/Transaction/TransactionTest.php b/tests/Service/Transaction/TransactionTest.php index 43ac97e..5db88c6 100644 --- a/tests/Service/Transaction/TransactionTest.php +++ b/tests/Service/Transaction/TransactionTest.php @@ -69,7 +69,7 @@ public function testGetFormData() $this->transaction->importData($data); $this->assertEquals($expectedData, $this->transaction->getFormData()); } - + public function testGetVerifyFormData() { $data = [ @@ -118,7 +118,7 @@ public function testGetVerifyFormData() $this->transaction->importData($data); $this->assertEquals($expectedData, $this->transaction->getVerifyFormData()); } - + public function testGetServiceFormData() { $data = [ @@ -245,6 +245,7 @@ public function getTokenFormDataTest() AddressInterface::CREATED => '2016-12-12', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ]), 'expectedData' => [ TransactionInterface::AMOUNT => 'amount', @@ -267,9 +268,10 @@ public function getTokenFormDataTest() AddressInterface::REGION => 'region', AddressInterface::STREET1 => 'street1', AddressInterface::STREET2 => 'street2', + AddressInterface::STREET3 => 'street3', ], ] - ] + ] ]; } }