PayPal\Api\Refund::get PHP Method

get() public static method

Shows details for a refund, by ID.
public static get ( string $refundId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Refund
$refundId string
$apiContext PayPal\Rest\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
return Refund
    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;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @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);
 }
All Usage Examples Of PayPal\Api\Refund::get