当前位置: 首页>>代码示例>>PHP>>正文


PHP Discount::factory方法代码示例

本文整理汇总了PHP中Discount::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Discount::factory方法的具体用法?PHP Discount::factory怎么用?PHP Discount::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Discount的用法示例。


在下文中一共展示了Discount::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initialize

 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;
     $planArray = [];
     if (isset($attributes['plans'])) {
         foreach ($attributes['plans'] as $plan) {
             $planArray[] = self::factory($plan);
         }
     }
     $this->_attributes['plans'] = $planArray;
 }
开发者ID:atulparmar,项目名称:braintree_php,代码行数:25,代码来源:Plan.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

 /**
  * sets instance properties from an array of values
  *
  * @ignore
  * @access protected
  * @param array $transactionAttribs array of transaction data
  * @return void
  */
 protected function _initialize($transactionAttribs)
 {
     $this->_attributes = $transactionAttribs;
     if (isset($transactionAttribs['applePay'])) {
         $this->_set('applePayCardDetails', new Transaction\ApplePayCardDetails($transactionAttribs['applePay']));
     }
     if (isset($transactionAttribs['androidPayCard'])) {
         $this->_set('androidPayCardDetails', new Transaction\AndroidPayCardDetails($transactionAttribs['androidPayCard']));
     }
     if (isset($transactionAttribs['amexExpressCheckoutCard'])) {
         $this->_set('amexExpressCheckoutCardDetails', new Transaction\AmexExpressCheckoutCardDetails($transactionAttribs['amexExpressCheckoutCard']));
     }
     if (isset($transactionAttribs['venmoAccount'])) {
         $this->_set('venmoAccountDetails', new Transaction\VenmoAccountDetails($transactionAttribs['venmoAccount']));
     }
     if (isset($transactionAttribs['creditCard'])) {
         $this->_set('creditCardDetails', new Transaction\CreditCardDetails($transactionAttribs['creditCard']));
     }
     if (isset($transactionAttribs['coinbaseAccount'])) {
         $this->_set('coinbaseDetails', new Transaction\CoinbaseDetails($transactionAttribs['coinbaseAccount']));
     }
     if (isset($transactionAttribs['europeBankAccount'])) {
         $this->_set('europeBankAccount', new Transaction\EuropeBankAccountDetails($transactionAttribs['europeBankAccount']));
     }
     if (isset($transactionAttribs['usBankAccount'])) {
         $this->_set('usBankAccount', new Transaction\UsBankAccountDetails($transactionAttribs['usBankAccount']));
     }
     if (isset($transactionAttribs['paypal'])) {
         $this->_set('paypalDetails', new Transaction\PayPalDetails($transactionAttribs['paypal']));
     }
     if (isset($transactionAttribs['customer'])) {
         $this->_set('customerDetails', new Transaction\CustomerDetails($transactionAttribs['customer']));
     }
     if (isset($transactionAttribs['billing'])) {
         $this->_set('billingDetails', new Transaction\AddressDetails($transactionAttribs['billing']));
     }
     if (isset($transactionAttribs['shipping'])) {
         $this->_set('shippingDetails', new Transaction\AddressDetails($transactionAttribs['shipping']));
     }
     if (isset($transactionAttribs['subscription'])) {
         $this->_set('subscriptionDetails', new Transaction\SubscriptionDetails($transactionAttribs['subscription']));
     }
     if (isset($transactionAttribs['descriptor'])) {
         $this->_set('descriptor', new Descriptor($transactionAttribs['descriptor']));
     }
     if (isset($transactionAttribs['disbursementDetails'])) {
         $this->_set('disbursementDetails', new DisbursementDetails($transactionAttribs['disbursementDetails']));
     }
     $disputes = [];
     if (isset($transactionAttribs['disputes'])) {
         foreach ($transactionAttribs['disputes'] as $dispute) {
             $disputes[] = Dispute::factory($dispute);
         }
     }
     $this->_set('disputes', $disputes);
     $statusHistory = [];
     if (isset($transactionAttribs['statusHistory'])) {
         foreach ($transactionAttribs['statusHistory'] as $history) {
             $statusHistory[] = new Transaction\StatusDetails($history);
         }
     }
     $this->_set('statusHistory', $statusHistory);
     $addOnArray = [];
     if (isset($transactionAttribs['addOns'])) {
         foreach ($transactionAttribs['addOns'] as $addOn) {
             $addOnArray[] = AddOn::factory($addOn);
         }
     }
     $this->_set('addOns', $addOnArray);
     $discountArray = [];
     if (isset($transactionAttribs['discounts'])) {
         foreach ($transactionAttribs['discounts'] as $discount) {
             $discountArray[] = Discount::factory($discount);
         }
     }
     $this->_set('discounts', $discountArray);
     if (isset($transactionAttribs['riskData'])) {
         $this->_set('riskData', RiskData::factory($transactionAttribs['riskData']));
     }
     if (isset($transactionAttribs['threeDSecureInfo'])) {
         $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo']));
     }
     if (isset($transactionAttribs['facilitatorDetails'])) {
         $this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails']));
     }
 }
开发者ID:braintree,项目名称:braintree_php,代码行数:94,代码来源:Transaction.php


注:本文中的Discount::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。