Adding apiContext arg for static methods

This commit is contained in:
aydiv
2013-04-25 18:04:49 +05:30
parent 0699f628bd
commit cbc9055e4d
4 changed files with 34 additions and 19 deletions

View File

@@ -181,15 +181,18 @@ class Refund extends Resource implements IResource {
/**
* @path /v1/payments/refund/:refund-id
* @method GET
* @param string $refundid
* @param string $refundid
* @param PayPal\Rest\ApiContext $apiContext optional
*/
public static function get( $refundid) {
if (($refundid == null) || (strlen($refundid) <= 0)) {
throw new \InvalidArgumentException("refundid cannot be null or empty");
}
$payLoad = "";
$apiContext = new ApiContext(self::$credential); $call = new \PPRestCall();
if($apiContext == null) {
$apiContext = new ApiContext(self::$credential);
}
$call = new \PPRestCall();
$json = $call->execute($apiContext, array('PayPal\Rest\RestHandler'),
"/v1/payments/refund/$refundid",
"GET", $payLoad);