diff --git a/src/SubscribePro/Service/Transaction/Transaction.php b/src/SubscribePro/Service/Transaction/Transaction.php index 320c5cf..062c52c 100644 --- a/src/SubscribePro/Service/Transaction/Transaction.php +++ b/src/SubscribePro/Service/Transaction/Transaction.php @@ -21,7 +21,8 @@ class Transaction extends DataObject implements TransactionInterface self::CURRENCY_CODE => true, self::ORDER_ID => false, self::IP => false, - self::EMAIL => false + self::EMAIL => false, + self::UNIQUE_ID => false ]; /** @@ -34,7 +35,8 @@ class Transaction extends DataObject implements TransactionInterface self::IP => false, self::EMAIL => false, self::CREDITCARD_MONTH => false, - self::CREDITCARD_YEAR => false + self::CREDITCARD_YEAR => false, + self::UNIQUE_ID => false ]; /** @@ -309,6 +311,23 @@ public function setCreditcardYear($creditcardYear) return $this->setData(self::CREDITCARD_YEAR, $creditcardYear); } + /** + * @return int|null + */ + public function getUniqueId() + { + return $this->getData(self::UNIQUE_ID); + } + + /** + * @param int $uniqueId + * @return $this + */ + public function setUniqueId($uniqueId) + { + return $this->setData(self::UNIQUE_ID, $uniqueId); + } + /** * @return int|null */ diff --git a/src/SubscribePro/Service/Transaction/TransactionInterface.php b/src/SubscribePro/Service/Transaction/TransactionInterface.php index 4805735..b6cccb7 100644 --- a/src/SubscribePro/Service/Transaction/TransactionInterface.php +++ b/src/SubscribePro/Service/Transaction/TransactionInterface.php @@ -21,6 +21,7 @@ interface TransactionInterface extends DataInterface const CREDITCARD_MONTH = 'creditcard_month'; const CREDITCARD_YEAR = 'creditcard_year'; const BILLING_ADDRESS = 'billing_address'; + const UNIQUE_ID = 'unique_id'; const REF_PAYMENT_PROFILE_ID = 'ref_payment_profile_id'; const REF_TRANSACTION_ID = 'ref_transaction_id'; const REF_GATEWAY_ID = 'ref_gateway_id'; @@ -219,6 +220,17 @@ public function getCreditcardYear(); */ public function setCreditcardYear($creditcardYear); + /** + * @return int|null + */ + public function getUniqueId(); + + /** + * @param int $uniqueId + * @return $this + */ + public function setUniqueId($uniqueId); + /** * @return int|null */ diff --git a/tests/Service/Transaction/TransactionTest.php b/tests/Service/Transaction/TransactionTest.php index 4de9ea9..eb1c775 100644 --- a/tests/Service/Transaction/TransactionTest.php +++ b/tests/Service/Transaction/TransactionTest.php @@ -149,6 +149,7 @@ public function testGetFormData() TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', TransactionInterface::BILLING_ADDRESS => '123', + TransactionInterface::UNIQUE_ID => '123456789', TransactionInterface::REF_PAYMENT_PROFILE_ID => '414', TransactionInterface::REF_TRANSACTION_ID => '2323', TransactionInterface::REF_GATEWAY_ID => '525', @@ -178,6 +179,7 @@ public function testGetFormData() TransactionInterface::EMAIL => 'email@example.com', TransactionInterface::ORDER_ID => '123', TransactionInterface::IP => '0.0.0.0', + TransactionInterface::UNIQUE_ID => '123456789' ]; $this->transaction->importData($data); @@ -198,6 +200,7 @@ public function testGetVerifyFormData() TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', TransactionInterface::BILLING_ADDRESS => '123', + TransactionInterface::UNIQUE_ID => '987654321', TransactionInterface::REF_PAYMENT_PROFILE_ID => '414', TransactionInterface::REF_TRANSACTION_ID => '2323', TransactionInterface::REF_GATEWAY_ID => '525', @@ -225,7 +228,7 @@ public function testGetVerifyFormData() TransactionInterface::CURRENCY_CODE => 'currency code', TransactionInterface::EMAIL => 'email@example.com', TransactionInterface::ORDER_ID => '123', - TransactionInterface::IP => '0.0.0.0', + TransactionInterface::IP => '0.0.0.0' ]; $this->transaction->importData($data); @@ -246,6 +249,7 @@ public function testGetServiceFormData() TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', TransactionInterface::BILLING_ADDRESS => '123', + TransactionInterface::UNIQUE_ID => '918273645', TransactionInterface::REF_PAYMENT_PROFILE_ID => '414', TransactionInterface::REF_TRANSACTION_ID => '2323', TransactionInterface::REF_GATEWAY_ID => '525', @@ -297,6 +301,7 @@ public function testGetTokenFormData($address, $expectedData) TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', TransactionInterface::BILLING_ADDRESS => '123', + TransactionInterface::UNIQUE_ID => '129834765', TransactionInterface::REF_PAYMENT_PROFILE_ID => '414', TransactionInterface::REF_TRANSACTION_ID => '2323', TransactionInterface::REF_GATEWAY_ID => '525', @@ -338,6 +343,7 @@ public function getTokenFormDataTest() TransactionInterface::IP => '0.0.0.0', TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', + TransactionInterface::UNIQUE_ID => '129834765' ] ], 'With address' => [ @@ -364,6 +370,7 @@ public function getTokenFormDataTest() TransactionInterface::IP => '0.0.0.0', TransactionInterface::CREDITCARD_MONTH => '04', TransactionInterface::CREDITCARD_YEAR => '2019', + TransactionInterface::UNIQUE_ID => '129834765', TransactionInterface::BILLING_ADDRESS => [ AddressInterface::CITY => 'city', AddressInterface::COUNTRY => 'country',