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


PHP Braintree_Subscription::factory方法代碼示例

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


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

示例1: __construct

 /**
  * overrides default constructor
  * @ignore
  * @param array $response gateway response array
  */
 public function __construct($response)
 {
     $this->_attributes = $response;
     $this->_set('errors', new Braintree_Error_ErrorCollection($response['errors']));
     if (isset($response['verification'])) {
         $this->_set('creditCardVerification', new Braintree_Result_CreditCardVerification($response['verification']));
     } else {
         $this->_set('creditCardVerification', null);
     }
     if (isset($response['transaction'])) {
         $this->_set('transaction', Braintree_Transaction::factory($response['transaction']));
     } else {
         $this->_set('transaction', null);
     }
     if (isset($response['subscription'])) {
         $this->_set('subscription', Braintree_Subscription::factory($response['subscription']));
     } else {
         $this->_set('subscription', null);
     }
     if (isset($response['merchantAccount'])) {
         $this->_set('merchantAccount', Braintree_MerchantAccount::factory($response['merchantAccount']));
     } else {
         $this->_set('merchantAccount', null);
     }
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:30,代碼來源:Error.php

示例2: _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', Braintree_Subscription::factory($attributes['subject']['subscription']));
     }
     if (isset($wrapperNode['merchantAccount'])) {
         $this->_set('merchantAccount', Braintree_MerchantAccount::factory($wrapperNode['merchantAccount']));
     }
     if (isset($wrapperNode['transaction'])) {
         $this->_set('transaction', Braintree_Transaction::factory($wrapperNode['transaction']));
     }
     if (isset($wrapperNode['disbursement'])) {
         $this->_set('disbursement', Braintree_Disbursement::factory($wrapperNode['disbursement']));
     }
     if (isset($wrapperNode['partnerMerchant'])) {
         $this->_set('partnerMerchant', Braintree_PartnerMerchant::factory($wrapperNode['partnerMerchant']));
     }
     if (isset($wrapperNode['errors'])) {
         $this->_set('errors', new Braintree_Error_ValidationErrorCollection($wrapperNode['errors']));
         $this->_set('message', $wrapperNode['message']);
     }
 }
開發者ID:bobstermyang,項目名稱:communityfoodshare,代碼行數:28,代碼來源:WebhookNotification.php

示例3: _initialize

 protected function _initialize($attributes)
 {
     $this->_attributes = $attributes;
     if (isset($attributes['subject']) && isset($attributes['subject']['subscription'])) {
         $this->_set('subscription', Braintree_Subscription::factory($attributes['subject']['subscription']));
     }
 }
開發者ID:danielcoats,項目名稱:schoolpress,代碼行數:7,代碼來源:WebhookNotification.php

示例4: _initialize

 /**
  * sets instance properties from an array of values
  *
  * @access protected
  * @param array $paypalAccountAttribs array of paypalAccount data
  * @return none
  */
 protected function _initialize($paypalAccountAttribs)
 {
     // set the attributes
     $this->_attributes = $paypalAccountAttribs;
     $subscriptionArray = array();
     if (isset($paypalAccountAttribs['subscriptions'])) {
         foreach ($paypalAccountAttribs['subscriptions'] as $subscription) {
             $subscriptionArray[] = Braintree_Subscription::factory($subscription);
         }
     }
     $this->_set('subscriptions', $subscriptionArray);
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:19,代碼來源:PayPalAccount.php

示例5: _initialize

 /**
  * sets instance properties from an array of values
  *
  * @access protected
  * @param array $applePayCardAttribs array of Apple Pay card properties
  * @return none
  */
 protected function _initialize($applePayCardAttribs)
 {
     // set the attributes
     $this->_attributes = $applePayCardAttribs;
     $subscriptionArray = array();
     if (isset($applePayCardAttribs['subscriptions'])) {
         foreach ($applePayCardAttribs['subscriptions'] as $subscription) {
             $subscriptionArray[] = Braintree_Subscription::factory($subscription);
         }
     }
     $this->_set('subscriptions', $subscriptionArray);
     $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
 }
開發者ID:nstungxd,項目名稱:F2CA5,代碼行數:20,代碼來源:ApplePayCard.php

示例6: _initialize

 /**
  * sets instance properties from an array of values
  *
  * @access protected
  * @param array $creditCardAttribs array of creditcard data
  * @return none
  */
 protected function _initialize($creditCardAttribs)
 {
     // set the attributes
     $this->_attributes = $creditCardAttribs;
     // map each address into its own object
     $billingAddress = isset($creditCardAttribs['billingAddress']) ? Braintree_Address::factory($creditCardAttribs['billingAddress']) : null;
     $subscriptionArray = array();
     if (isset($creditCardAttribs['subscriptions'])) {
         foreach ($creditCardAttribs['subscriptions'] as $subscription) {
             $subscriptionArray[] = Braintree_Subscription::factory($subscription);
         }
     }
     $this->_set('subscriptions', $subscriptionArray);
     $this->_set('billingAddress', $billingAddress);
     $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
     $this->_set('maskedNumber', $this->bin . '******' . $this->last4);
 }
開發者ID:anmolview,項目名稱:yiidemos,代碼行數:24,代碼來源:CreditCard.php

示例7: _verifyGatewayResponse

 /**
  * @ignore
  */
 private function _verifyGatewayResponse($response)
 {
     if (isset($response['subscription'])) {
         return new Braintree_Result_Successful(Braintree_Subscription::factory($response['subscription']));
     } else {
         if (isset($response['transaction'])) {
             // return a populated instance of Braintree_Transaction, for subscription retryCharge
             return new Braintree_Result_Successful(Braintree_Transaction::factory($response['transaction']));
         } else {
             if (isset($response['apiErrorResponse'])) {
                 return new Braintree_Result_Error($response['apiErrorResponse']);
             } else {
                 throw new Braintree_Exception_Unexpected("Expected subscription, transaction, or apiErrorResponse");
             }
         }
     }
 }
開發者ID:portchris,項目名稱:NaturalRemedyCompany,代碼行數:20,代碼來源:SubscriptionGateway.php


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