From b21a33a497960bf8236be9bfdfd6ba6ccbb84ffb Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 21:43:13 -0500 Subject: [PATCH 1/9] LI-93872 - Introduce payment's notes field --- CHANGELOG.md | 4 ++++ examples/three-step-tutorial.php | 1 + src/Hyperwallet/Model/Payment.php | 31 ++++++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d919679..83c1878f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ChangeLog ========= +2.2.6 +------------------- +- Added field 'notes' to Payment. + 2.2.5 ------------------- - Added field 'accountId' to PayPal. diff --git a/examples/three-step-tutorial.php b/examples/three-step-tutorial.php index 3c74997e..107f5319 100644 --- a/examples/three-step-tutorial.php +++ b/examples/three-step-tutorial.php @@ -89,6 +89,7 @@ ->setClientPaymentId(uniqid('psdk-')) ->setCurrency('USD') ->setAmount('50.25') + ->setNotes("Payment") ->setPurpose('OTHER'); try { $payment = $hyperwallet->createPayment($payment); diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index 65d26955..f3893f5f 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -13,6 +13,7 @@ * @property string $currency The payment currency * * @property string $description The payment description + * @property string $notes The payment notes * @property string $memo The payment memo * @property string $purpose The payment purpose * @property \DateTime $releaseOn The payment release date @@ -158,21 +159,41 @@ public function setCurrency($currency) { /** * Get the payment description - * + * @deprecated Use getNotes() instead. * @return string */ public function getDescription() { - return $this->description; + return $this->notes; } /** - * Set the payment description - * + * Set the payment description () + * @deprecated Use setNotes(string $notes) instead. * @param string $description * @return Payment */ public function setDescription($description) { - $this->description = $description; + $this->notes = $description; + return $this; + } + + /** + * Get the payment notes + * + * @return string + */ + public function getNotes() { + return $this->notes; + } + + /** + * Set the payment notes + * + * @param string $notes + * @return notes + */ + public function setNotes($notes) { + $this->notes = $notes; return $this; } From 676f9cbf3dd87b17ea321c96d9f981a10472bd08 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 21:50:02 -0500 Subject: [PATCH 2/9] LI-93872 - Introduce payment's notes field --- src/Hyperwallet/Model/Payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index f3893f5f..284a859c 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -163,7 +163,7 @@ public function setCurrency($currency) { * @return string */ public function getDescription() { - return $this->notes; + return $this->description; } /** @@ -173,7 +173,7 @@ public function getDescription() { * @return Payment */ public function setDescription($description) { - $this->notes = $description; + $this->description = $description; return $this; } From c12e12f657eadb6d98e6b75d98146ad5de2bcd9a Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 21:58:08 -0500 Subject: [PATCH 3/9] LI-93872 - Update change log --- CHANGELOG.md | 3 ++- src/Hyperwallet/Model/Payment.php | 20 -------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83c1878f..05e2ac69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ChangeLog ========= 2.2.6 ------------------- -- Added field 'notes' to Payment. +- Added a new notes field to the Payment object, allowing users to include supplementary information or comments related to a payment. +- Removed the description field from the Payment object. Please use the new notes field in its place for all future implementations. 2.2.5 ------------------- diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index 284a859c..c49d57af 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -157,26 +157,6 @@ public function setCurrency($currency) { return $this; } - /** - * Get the payment description - * @deprecated Use getNotes() instead. - * @return string - */ - public function getDescription() { - return $this->description; - } - - /** - * Set the payment description () - * @deprecated Use setNotes(string $notes) instead. - * @param string $description - * @return Payment - */ - public function setDescription($description) { - $this->description = $description; - return $this; - } - /** * Get the payment notes * From b9fd72984b12398fa2c6df6ca73d173298bffe2a Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:05:54 -0500 Subject: [PATCH 4/9] LI-93872 - Update change log --- CHANGELOG.md | 2 +- src/Hyperwallet/Model/Payment.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e2ac69..24c1cc54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ChangeLog 2.2.6 ------------------- - Added a new notes field to the Payment object, allowing users to include supplementary information or comments related to a payment. -- Removed the description field from the Payment object. Please use the new notes field in its place for all future implementations. +- Deprecated the description field from the Payment object. Please use the new notes field in its place for all future implementations. 2.2.5 ------------------- diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index c49d57af..f7d2b308 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -157,6 +157,29 @@ public function setCurrency($currency) { return $this; } + /** + * Retrieves the legacy payment description. + * + * @deprecated Use getNotes() instead. + * @return string + */ + public function getDescription() { + return $this->notes; + } + + /** + * Set the payment description + + * @deprecated Use setNotes(string $notes) instead. + * @param string $description + * @return Payment + */ + public function setDescription($description) { + $this->description = $description; + $this->notes = $description; + return $this; + } + /** * Get the payment notes * From c78ecded5b1c44745e98feafe86d4b86c17c444e Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:14:02 -0500 Subject: [PATCH 5/9] LI-93872 - Update change log --- src/Hyperwallet/Model/Payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index f7d2b308..02dea490 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -175,8 +175,8 @@ public function getDescription() { * @return Payment */ public function setDescription($description) { - $this->description = $description; $this->notes = $description; + $this->description = $description; return $this; } From be12189b85ca02576a376c228da1b68393b099a2 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:20:43 -0500 Subject: [PATCH 6/9] LI-93872 - Update change log --- src/Hyperwallet/Model/Payment.php | 1 - tests/Hyperwallet/Tests/Model/PaymentTest.php | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index 02dea490..0396c8dc 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -176,7 +176,6 @@ public function getDescription() { */ public function setDescription($description) { $this->notes = $description; - $this->description = $description; return $this; } diff --git a/tests/Hyperwallet/Tests/Model/PaymentTest.php b/tests/Hyperwallet/Tests/Model/PaymentTest.php index 295cf3ed..59de1385 100644 --- a/tests/Hyperwallet/Tests/Model/PaymentTest.php +++ b/tests/Hyperwallet/Tests/Model/PaymentTest.php @@ -58,6 +58,11 @@ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIs * @param string $property The property to look for */ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSet($property) { + + if ($property === 'description') { + // skip deprecated field + return; + } $this->performGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSetTest($property); } From ace81de2babbe5e336ea167f416228d57812a4cf Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:24:10 -0500 Subject: [PATCH 7/9] LI-93872 - Update change log --- tests/Hyperwallet/Tests/Model/PaymentTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Hyperwallet/Tests/Model/PaymentTest.php b/tests/Hyperwallet/Tests/Model/PaymentTest.php index 59de1385..8a562441 100644 --- a/tests/Hyperwallet/Tests/Model/PaymentTest.php +++ b/tests/Hyperwallet/Tests/Model/PaymentTest.php @@ -60,7 +60,8 @@ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIs public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSet($property) { if ($property === 'description') { - // skip deprecated field + // skip testing invalid and deprecated field + $this->assertEquals($property, 'description'); return; } $this->performGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSetTest($property); From f459ee13e23375200c6532f7a02273bf349eda79 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:29:15 -0500 Subject: [PATCH 8/9] LI-93872 - Update change log --- tests/Hyperwallet/Tests/Model/PaymentTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Hyperwallet/Tests/Model/PaymentTest.php b/tests/Hyperwallet/Tests/Model/PaymentTest.php index 8a562441..4a3bc3ee 100644 --- a/tests/Hyperwallet/Tests/Model/PaymentTest.php +++ b/tests/Hyperwallet/Tests/Model/PaymentTest.php @@ -31,6 +31,12 @@ public function testGettersAndSettersForNotIgnoredProperties($property) { * @param string $property The property to look for */ public function testGetterReturnValueIsSet($property) { + if ($property === 'description') { + // skip testing invalid and deprecated field + $this->assertEquals($property, 'description'); + return; + } + $this->performGetterReturnValueIsSetTest($property); } @@ -58,12 +64,12 @@ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIs * @param string $property The property to look for */ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSet($property) { - if ($property === 'description') { // skip testing invalid and deprecated field $this->assertEquals($property, 'description'); return; } + $this->performGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsNotSetTest($property); } From c0167018fa085ad9faf7f6464b4e566c08c9c108 Mon Sep 17 00:00:00 2001 From: Gustavo Meyer Date: Thu, 4 Dec 2025 22:32:04 -0500 Subject: [PATCH 9/9] LI-93872 - Update change log --- tests/Hyperwallet/Tests/Model/PaymentTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Hyperwallet/Tests/Model/PaymentTest.php b/tests/Hyperwallet/Tests/Model/PaymentTest.php index 4a3bc3ee..9bafbaa3 100644 --- a/tests/Hyperwallet/Tests/Model/PaymentTest.php +++ b/tests/Hyperwallet/Tests/Model/PaymentTest.php @@ -55,6 +55,12 @@ public function testGetterReturnValueIsNotSet($property) { * @param string $property The property to look for */ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsSet($property) { + if ($property === 'description') { + // skip testing invalid and deprecated field + $this->assertEquals($property, 'description'); + return; + } + $this->performGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIsSetTest($property); } @@ -79,6 +85,12 @@ public function testGetterAndSetterReturnValueIsSetIfValueIsProvidedAndDefaultIs * @param string $property The property to look for */ public function testGetterAndSetterNullField($property) { + if ($property === 'description') { + // skip testing invalid and deprecated field + $this->assertEquals($property, 'description'); + return; + } + $this->performGetterAndSetterNullFieldTest($property); }