Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Added note_to_payer property to Capture class #1134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/PayPal/Api/Capture.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down
4 changes: 3 additions & 1 deletion tests/PayPal/Test/Api/CaptureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() . '}';
}

/**
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down