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