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


PHP Transaction::factory方法代碼示例

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


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

示例1: _doTestRequest

 private function _doTestRequest($testPath, $transactionId)
 {
     self::_checkEnvironment();
     $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . $testPath;
     $response = $this->_http->put($path);
     return Transaction::factory($response['transaction']);
 }
開發者ID:braintree,項目名稱:braintree_php,代碼行數:7,代碼來源:TestingGateway.php

示例2: _initialize

 /**
  * @ignore
  */
 protected function _initialize($attributes)
 {
     $this->_attributes = $attributes;
     $addOnArray = [];
     if (isset($attributes['addOns'])) {
         foreach ($attributes['addOns'] as $addOn) {
             $addOnArray[] = AddOn::factory($addOn);
         }
     }
     $this->_attributes['addOns'] = $addOnArray;
     $discountArray = [];
     if (isset($attributes['discounts'])) {
         foreach ($attributes['discounts'] as $discount) {
             $discountArray[] = Discount::factory($discount);
         }
     }
     $this->_attributes['discounts'] = $discountArray;
     if (isset($attributes['descriptor'])) {
         $this->_set('descriptor', new Descriptor($attributes['descriptor']));
     }
     $statusHistory = [];
     if (isset($attributes['statusHistory'])) {
         foreach ($attributes['statusHistory'] as $history) {
             $statusHistory[] = new Subscription\StatusDetails($history);
         }
     }
     $this->_attributes['statusHistory'] = $statusHistory;
     $transactionArray = [];
     if (isset($attributes['transactions'])) {
         foreach ($attributes['transactions'] as $transaction) {
             $transactionArray[] = Transaction::factory($transaction);
         }
     }
     $this->_attributes['transactions'] = $transactionArray;
 }
開發者ID:atulparmar,項目名稱:braintree_php,代碼行數:38,代碼來源:Subscription.php

示例3: _initialize

 protected function _initialize($attributes)
 {
     $this->_attributes = $attributes;
     if (isset($attributes['subject']['apiErrorResponse'])) {
         $wrapperNode = $attributes['subject']['apiErrorResponse'];
     } else {
         $wrapperNode = $attributes['subject'];
     }
     if (isset($wrapperNode['subscription'])) {
         $this->_set('subscription', Subscription::factory($attributes['subject']['subscription']));
     }
     if (isset($wrapperNode['merchantAccount'])) {
         $this->_set('merchantAccount', MerchantAccount::factory($wrapperNode['merchantAccount']));
     }
     if (isset($wrapperNode['transaction'])) {
         $this->_set('transaction', Transaction::factory($wrapperNode['transaction']));
     }
     if (isset($wrapperNode['disbursement'])) {
         $this->_set('disbursement', Disbursement::factory($wrapperNode['disbursement']));
     }
     if (isset($wrapperNode['partnerMerchant'])) {
         $this->_set('partnerMerchant', PartnerMerchant::factory($wrapperNode['partnerMerchant']));
     }
     if (isset($wrapperNode['dispute'])) {
         $this->_set('dispute', Dispute::factory($wrapperNode['dispute']));
     }
     if (isset($wrapperNode['accountUpdaterDailyReport'])) {
         $this->_set('accountUpdaterDailyReport', AccountUpdaterDailyReport::factory($wrapperNode['accountUpdaterDailyReport']));
     }
     if (isset($wrapperNode['errors'])) {
         $this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors']));
         $this->_set('message', $wrapperNode['message']);
     }
 }
開發者ID:EfraimKrug,項目名稱:Canneur,代碼行數:34,代碼來源:WebhookNotification.php


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