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