public static get ( string $refundId, |
||
$refundId | string | |
$apiContext | is the APIContext for this call. It can be used to pass dynamic configuration and credentials. | |
$restCall | PayPalRestCall | is the Rest Call Service that is used to make rest calls |
Результат |
public static function get($refundId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($refundId, 'refundId');
$payLoad = "";
$json = self::executeCall("/v1/payments/refund/{$refundId}", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new Refund();
$ret->fromJson($json);
return $ret;
}
/** * @dataProvider mockProvider * @param Refund $obj */ public function testGet($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(RefundTest::getJson())); $result = $obj->get("refundId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }