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


PHP Model::gatewayCustomer方法代碼示例

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


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

示例1: find

 /**
  * Find and return a credit card.
  *
  * @param mixed $id
  * 
  * @return Invoice
  */
 public function find($id)
 {
     try {
         return new Invoice($this->model, $this->model->gatewayCustomer()->invoice($id));
     } catch (\Exception $e) {
     }
     return null;
 }
開發者ID:linkthrow,項目名稱:laravel-billing,代碼行數:15,代碼來源:Invoices.php

示例2: create

 /**
  * Add a new credit card to this customer in the billing gateway.
  *
  * @param string $card_token
  * 
  * @return Creditcard
  */
 public function create($card_token)
 {
     if (!$this->model->readyForBilling()) {
         return;
     }
     $card = new Creditcard($this->model, $this->model->gatewayCustomer()->card()->create($card_token));
     $this->model->billing_cards = array_merge($this->model->billing_cards, array($card->toArray()));
     $this->model->save();
     return $card;
 }
開發者ID:autocar,項目名稱:laravel-billing,代碼行數:17,代碼來源:Creditcards.php

示例3: create

 /**
  * Create this charge in the billing gateway.
  *
  * @param int   $amount
  * @param array $properties
  * 
  * @return Charge
  */
 public function create($amount, array $properties = array())
 {
     if (!$this->model->readyForBilling()) {
         if ($this->card_token) {
             $this->model->billing()->withCardToken($this->card_token)->create($properties);
             if (!empty($this->model->billing_cards)) {
                 $this->card_token = null;
             }
         } else {
             $this->model->billing()->create($properties);
         }
     }
     if ($this->card_token) {
         $this->card = $this->model->creditcards()->create($this->card_token)->id;
         $this->card_token = null;
     }
     $gateway_charge = \LinkThrow\Billing\Facades\Billing::charge(null, $this->model->gatewayCustomer())->create($amount, array_merge($properties, array('card_token' => $this->card_token, 'card' => $this->card)));
     return new Charge($this->model, $gateway_charge);
 }
開發者ID:linkthrow,項目名稱:laravel-billing,代碼行數:27,代碼來源:Charges.php

示例4: __construct

 /**
  * Create a new CustomerBillableTrait Billing instance.
  *
  * @param Model $model
  *
  */
 public function __construct(Model $model)
 {
     $this->model = $model;
     $this->customer = $this->model->gatewayCustomer();
     $this->info = $this->customer ? $this->customer->info() : array();
 }
開發者ID:linkthrow,項目名稱:laravel-billing,代碼行數:12,代碼來源:Billing.php

示例5: __construct

 /**
  * Create a new CustomerBillableTrait Billing instance.
  *
  * @param \Illuminate\Database\Eloquent\Model $model
  *
  * @return void
  */
 public function __construct(\Illuminate\Database\Eloquent\Model $model)
 {
     $this->model = $model;
     $this->customer = $this->model->gatewayCustomer();
     $this->info = $this->customer ? $this->customer->info() : array();
 }
開發者ID:dorelljames,項目名稱:laravel-billing,代碼行數:13,代碼來源:Billing.php


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