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


PHP Transaction::setInvoiceNumber方法代碼示例

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


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

示例1: createTransaction

 /**
  * @param Amount $amount
  * @param ItemList $itemLists
  * @param string $invoiceNumber
  * @param string $description
  *
  * @return Transaction
  */
 public static function createTransaction(Amount $amount, ItemList $itemLists, $invoiceNumber, $description)
 {
     $transaction = new Transaction();
     $transaction->setAmount($amount);
     $transaction->setItemList($itemLists);
     $transaction->setInvoiceNumber($invoiceNumber);
     $transaction->setDescription($description);
     return $transaction;
 }
開發者ID:metisfw,項目名稱:paypal,代碼行數:17,代碼來源:TransactionHelper.php

示例2: createTransaction

 public static function createTransaction()
 {
     $transaction = new Transaction();
     $transaction->setAmount(AmountTest::createAmount());
     $transaction->setDescription(self::$description);
     $transaction->setInvoiceNumber(self::$invoiceNumber);
     $transaction->setCustom(self::$custom);
     $transaction->setSoftDescriptor(self::$softDescriptor);
     $transaction->setItemList(ItemListTest::createItemList());
     $transaction->setPayee(PayeeTest::createPayee());
     $transaction->setRelatedResources(array(RelatedResourcesTest::createRelatedResources()));
     return $transaction;
 }
開發者ID:aliuadepoju,項目名稱:hqpay,代碼行數:13,代碼來源:TransactionTest.php

示例3: callCreate

 public function callCreate($clientId, $clientSecret, $orderId, $amount, $currency, $description, $returnUrl, $cancelUrl)
 {
     $oauthCredential = new OAuthTokenCredential($clientId, $clientSecret);
     $apiContext = new ApiContext($oauthCredential);
     $apiContext->setConfig(['mode' => $this->mode]);
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $item = new Item();
     $item->setName($description);
     $item->setCurrency($currency);
     $item->setPrice($amount);
     $item->setQuantity(1);
     $itemList = new ItemList();
     $itemList->setItems(array($item));
     $amountObject = new Amount();
     $amountObject->setCurrency($currency);
     $amountObject->setTotal($amount);
     $transaction = new Transaction();
     $transaction->setItemList($itemList);
     $transaction->setAmount($amountObject);
     $transaction->setDescription($description);
     $transaction->setInvoiceNumber($orderId);
     $redirectUrls = new RedirectUrls();
     $redirectUrls->setReturnUrl($returnUrl)->setCancelUrl($cancelUrl);
     $payment = new Payment();
     $payment->setIntent('sale');
     $payment->setPayer($payer);
     $payment->setRedirectUrls($redirectUrls);
     $payment->setTransactions(array($transaction));
     try {
         $payment->create($apiContext);
     } catch (\Exception $e) {
         throw new PaymentException('PayPal Exception: ' . $e->getMessage());
     }
     $approvalUrl = $payment->getApprovalLink();
     return $approvalUrl;
 }
開發者ID:luyadev,項目名稱:luya-module-payment,代碼行數:37,代碼來源:PayPalProvider.php

示例4: setPaypalTransaction

 public function setPaypalTransaction($amount, $descr, $invoiceNumber, $itemList)
 {
     $transaction = new Transaction();
     $transaction->setAmount($amount);
     $transaction->setDescription($descr);
     $transaction->setInvoiceNumber($invoiceNumber);
     $transaction->setItemList($itemList);
     return $transaction;
 }
開發者ID:cinghie,項目名稱:yii2-paypal,代碼行數:9,代碼來源:Helper.php


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