Свойство | 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 | The user model that is subscribing. |
Méthode | Description | |
---|---|---|
__construct ( mixed $user, string $name, string $plan ) : void | Create a new subscription builder instance. | |
add ( array $options = [] ) : |
Add a new Braintree subscription to the user. | |
create ( string | null $token = null, array $customerOptions = [], array $subscriptionOptions = [] ) : |
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éthode | Description | |
---|---|---|
addCouponToPayload ( array $payload ) : array | Add the coupon discount to the Braintree payload. | |
getBraintreeCustomer ( string | null $token = null, array $options = [] ) : |
Get the Braintree customer instance for the current user and token. | |
getSubscriptionPayload ( |
Get the base subscription payload for Braintree. |
protected addCouponToPayload ( array $payload ) : array | ||
$payload | array | |
Résultat | array |
protected getSubscriptionPayload ( |
||
$customer | ||
$options | array | |
Résultat | array |
public withCoupon ( string $coupon ) | ||
$coupon | string |
protected string $plan | ||
Résultat | string |
protected bool $skipTrial | ||
Résultat | boolean |