當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PaymentExecution::toJSON方法代碼示例

本文整理匯總了PHP中PayPal\Api\PaymentExecution::toJSON方法的典型用法代碼示例。如果您正苦於以下問題:PHP PaymentExecution::toJSON方法的具體用法?PHP PaymentExecution::toJSON怎麽用?PHP PaymentExecution::toJSON使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PayPal\Api\PaymentExecution的用法示例。


在下文中一共展示了PaymentExecution::toJSON方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * Execute
  *
  * @param \Paypal\Api\PaymentExecution $paymentExecution
  * @param \PayPal\Rest\ApiContext|null $apiContext
  *
  * @return Payment
  * @throws \InvalidArgumentException
  */
 public function execute($paymentExecution, $apiContext = null)
 {
     if ($this->getId() == null) {
         throw new \InvalidArgumentException("Id cannot be null");
     }
     if ($paymentExecution == null) {
         throw new \InvalidArgumentException("paymentExecution cannot be null or empty");
     }
     $payLoad = $paymentExecution->toJSON();
     if ($apiContext == null) {
         $apiContext = new ApiContext(self::$credential);
     }
     $call = new PPRestCall($apiContext);
     $json = $call->execute(array('PayPal\\Rest\\RestHandler'), "/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad);
     $ret = new Payment();
     $ret->fromJson($json);
     return $ret;
 }
開發者ID:adiktus9116,項目名稱:rest-api-sdk-php,代碼行數:27,代碼來源:Payment.php

示例2: execute

 /**
  * @path /v1/payments/payment/:payment-id/execute
  * @method POST
  * @param PaymentExecution $payment_execution	  
  * @param PayPal\Rest\ApiContext $apiContext optional	  	 
  */
 public function execute($payment_execution, $apiContext = null)
 {
     if ($payment_execution == null) {
         throw new \InvalidArgumentException("payment_execution cannot be null");
     }
     if ($this->getId() == null) {
         throw new \InvalidArgumentException("Id cannot be null");
     }
     $payLoad = $payment_execution->toJSON();
     if ($apiContext == null) {
         $apiContext = new ApiContext(self::$credential);
     }
     $call = new Call();
     $json = $call->execute("/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad, $apiContext);
     $this->fromJson($json);
     return $this;
 }
開發者ID:mayoalexander,項目名稱:fl-two,代碼行數:23,代碼來源:Payment.php


注:本文中的PayPal\Api\PaymentExecution::toJSON方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。