PHP Class Laravel\Cashier\SubscriptionBuilder

Afficher le fichier Open project: laravel/cashier-braintree

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

Create a new subscription builder instance.
public __construct ( mixed $user, string $name, string $plan ) : void
$user mixed
$name string
$plan string
Résultat void

add() public méthode

Add a new Braintree subscription to the user.
public add ( array $options = [] ) : Subscription
$options array
Résultat Subscription

addCouponToPayload() protected méthode

Add the coupon discount to the Braintree payload.
protected addCouponToPayload ( array $payload ) : array
$payload array
Résultat array

create() public méthode

Create a new Braintree subscription.
public create ( string | null $token = null, array $customerOptions = [], array $subscriptionOptions = [] ) : Subscription
$token string | null
$customerOptions array
$subscriptionOptions array
Résultat Subscription

getBraintreeCustomer() protected méthode

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
Résultat Braintree\Customer

getSubscriptionPayload() protected méthode

Get the base subscription payload for Braintree.
protected getSubscriptionPayload ( Customer $customer, array $options = [] ) : array
$customer Braintree\Customer
$options array
Résultat array

skipTrial() public méthode

Force the trial to end immediately.
public skipTrial ( )

trialDays() public méthode

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

withCoupon() public méthode

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

Property Details

$coupon protected_oe property

The coupon code being applied to the customer.
protected string|null $coupon
Résultat string | null

$name protected_oe property

The name of the subscription.
protected string $name
Résultat string

$plan protected_oe property

The name of the plan being subscribed to.
protected string $plan
Résultat string

$skipTrial protected_oe property

Indicates that the trial should end immediately.
protected bool $skipTrial
Résultat boolean

$trialDays protected_oe property

The number of trial days to apply to the subscription.
protected int|null $trialDays
Résultat integer | null

$user protected_oe property

The user model that is subscribing.
protected Model,Illuminate\Database\Eloquent $user
Résultat Illuminate\Database\Eloquent\Model