PayPal\Api\Sale::get PHP Method

get() public static method

Shows details for a sale, by ID. Returns only sales that were created through the REST API.
public static get ( string $saleId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Sale
$saleId 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 Sale
    public static function get($saleId, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($saleId, 'saleId');
        $payLoad = "";
        $json = self::executeCall("/v1/payments/sale/{$saleId}", "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new Sale();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

 public function stupdate($transactionId, $apiContext)
 {
     if ($transactionId) {
         $sale = Sale::get($transactionId, $apiContext);
         $data = array('state' => $sale->getState());
         $this->getDbTable()->update($data, array('transaction_id = ?' => $transactionId));
         return $data['state'];
     }
 }
All Usage Examples Of PayPal\Api\Sale::get