public recordRefund ( |
||
$refundDetail | ||
$apiContext | is the APIContext for this call. It can be used to pass dynamic configuration and credentials. | |
$restCall | is the Rest Call Service that is used to make rest calls | |
리턴 | boolean |
public function recordRefund($refundDetail, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($refundDetail, 'refundDetail');
$payLoad = $refundDetail->toJSON();
self::executeCall("/v1/invoicing/invoices/{$this->getId()}/record-refund", "POST", $payLoad, null, $apiContext, $restCall);
return true;
}
/** * @dataProvider mockProvider * @param Invoice $obj */ public function testRecordRefund($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(true)); $refundDetail = RefundDetailTest::getObject(); $result = $obj->recordRefund($refundDetail, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }