当前位置: 首页>>代码示例>>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;未经允许,请勿转载。