From 515265fceaaaa0f5b32ad9e88e6e02a7ae768012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Go=CC=81mez?= Date: Tue, 3 Jul 2018 17:04:33 +0200 Subject: [PATCH] Added note_to_payer property to Capture class --- lib/PayPal/Api/Capture.php | 23 +++++++++++++++++++++++ tests/PayPal/Test/Api/CaptureTest.php | 4 +++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/PayPal/Api/Capture.php b/lib/PayPal/Api/Capture.php index 8358bfd7..cfec87c4 100644 --- a/lib/PayPal/Api/Capture.php +++ b/lib/PayPal/Api/Capture.php @@ -214,6 +214,29 @@ public function getTransactionFee() return $this->transaction_fee; } + /** + * A free-form field that clients can use to send a note to the payer. + * + * @param string $note_to_payer + * + * @return $this + */ + public function setNoteToPayer($note_to_payer) + { + $this->note_to_payer = $note_to_payer; + return $this; + } + + /** + * A free-form field that clients can use to send a note to the payer. + * + * @return string + */ + public function getNoteToPayer() + { + return $this->note_to_payer; + } + /** * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). * diff --git a/tests/PayPal/Test/Api/CaptureTest.php b/tests/PayPal/Test/Api/CaptureTest.php index 213be3ab..24a2a9a4 100644 --- a/tests/PayPal/Test/Api/CaptureTest.php +++ b/tests/PayPal/Test/Api/CaptureTest.php @@ -19,7 +19,7 @@ class CaptureTest extends TestCase */ public static function getJson() { - return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","reason_code":"TestSample","parent_payment":"TestSample","invoice_number":"TestSample","transaction_fee":' .CurrencyTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}'; + return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","reason_code":"TestSample","parent_payment":"TestSample","invoice_number":"TestSample","transaction_fee":' .CurrencyTest::getJson() . ',"note_to_payer":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}'; } /** @@ -48,6 +48,7 @@ public function testSerializationDeserialization() $this->assertNotNull($obj->getParentPayment()); $this->assertNotNull($obj->getInvoiceNumber()); $this->assertNotNull($obj->getTransactionFee()); + $this->assertNotNull($obj->getNoteToPayer()); $this->assertNotNull($obj->getCreateTime()); $this->assertNotNull($obj->getUpdateTime()); $this->assertNotNull($obj->getLinks()); @@ -69,6 +70,7 @@ public function testGetters($obj) $this->assertEquals($obj->getParentPayment(), "TestSample"); $this->assertEquals($obj->getInvoiceNumber(), "TestSample"); $this->assertEquals($obj->getTransactionFee(), CurrencyTest::getObject()); + $this->assertEquals($obj->getNoteToPayer(), "TestSample"); $this->assertEquals($obj->getCreateTime(), "TestSample"); $this->assertEquals($obj->getUpdateTime(), "TestSample"); $this->assertEquals($obj->getLinks(), LinksTest::getObject());