Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON.
public refund ( |
||
$refund | ||
$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 | |
return |
/** * @dataProvider mockProvider * @param Capture $obj */ public function testRefund($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(RefundTest::getJson())); $refund = RefundTest::getObject(); $result = $obj->refund($refund, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }