PHP Класс Laravel\Cashier\SubscriptionBuilder

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$coupon string | null The coupon code being applied to the customer.
$name string The name of the subscription.
$plan string The name of the plan being subscribed to.
$skipTrial boolean Indicates that the trial should end immediately.
$trialDays integer | null The number of trial days to apply to the subscription.
$user Illuminate\Database\Eloquent\Model The user model that is subscribing.

Открытые методы

Метод Описание
__construct ( mixed $user, string $name, string $plan ) : void Create a new subscription builder instance.
add ( array $options = [] ) : Subscription Add a new Braintree subscription to the user.
create ( string | null $token = null, array $customerOptions = [], array $subscriptionOptions = [] ) : Subscription Create a new Braintree subscription.
skipTrial ( ) Force the trial to end immediately.
trialDays ( integer $trialDays ) Specify the ending date of the trial.
withCoupon ( string $coupon ) The coupon to apply to a new subscription.

Защищенные методы

Метод Описание
addCouponToPayload ( array $payload ) : array Add the coupon discount to the Braintree payload.
getBraintreeCustomer ( string | null $token = null, array $options = [] ) : Customer Get the Braintree customer instance for the current user and token.
getSubscriptionPayload ( Customer $customer, array $options = [] ) : array Get the base subscription payload for Braintree.

Описание методов

__construct() публичный Метод

Create a new subscription builder instance.
public __construct ( mixed $user, string $name, string $plan ) : void
$user mixed
$name string
$plan string
Результат void

add() публичный Метод

Add a new Braintree subscription to the user.
public add ( array $options = [] ) : Subscription
$options array
Результат Subscription

addCouponToPayload() защищенный Метод

Add the coupon discount to the Braintree payload.
protected addCouponToPayload ( array $payload ) : array
$payload array
Результат array

create() публичный Метод

Create a new Braintree subscription.
public create ( string | null $token = null, array $customerOptions = [], array $subscriptionOptions = [] ) : Subscription
$token string | null
$customerOptions array
$subscriptionOptions array
Результат Subscription

getBraintreeCustomer() защищенный Метод

Get the Braintree customer instance for the current user and token.
protected getBraintreeCustomer ( string | null $token = null, array $options = [] ) : Customer
$token string | null
$options array
Результат Braintree\Customer

getSubscriptionPayload() защищенный Метод

Get the base subscription payload for Braintree.
protected getSubscriptionPayload ( Customer $customer, array $options = [] ) : array
$customer Braintree\Customer
$options array
Результат array

skipTrial() публичный Метод

Force the trial to end immediately.
public skipTrial ( )

trialDays() публичный Метод

Specify the ending date of the trial.
public trialDays ( integer $trialDays )
$trialDays integer

withCoupon() публичный Метод

The coupon to apply to a new subscription.
public withCoupon ( string $coupon )
$coupon string

Описание свойств

$coupon защищенное свойство

The coupon code being applied to the customer.
protected string|null $coupon
Результат string | null

$name защищенное свойство

The name of the subscription.
protected string $name
Результат string

$plan защищенное свойство

The name of the plan being subscribed to.
protected string $plan
Результат string

$skipTrial защищенное свойство

Indicates that the trial should end immediately.
protected bool $skipTrial
Результат boolean

$trialDays защищенное свойство

The number of trial days to apply to the subscription.
protected int|null $trialDays
Результат integer | null

$user защищенное свойство

The user model that is subscribing.
protected Model,Illuminate\Database\Eloquent $user
Результат Illuminate\Database\Eloquent\Model