Property | Type | Description | |
---|---|---|---|
$dates | array | The attributes that should be mutated to dates. | |
$guarded | array | The attributes that aren't mass assignable. |
Method | Description | |
---|---|---|
active ( ) : boolean | Determine if the subscription is active. | |
applyCoupon ( $coupon, $removeOthers = false ) | * Apply a coupon to the subscription. | |
asBraintreeSubscription ( ) : Braintree\Subscription | Get the subscription as a Braintree subscription object. | |
cancel ( ) | Cancel the subscription. | |
cancelNow ( ) | Cancel the subscription immediately. | |
cancelled ( ) : boolean | Determine if the subscription is no longer active. | |
markAsCancelled ( ) : void | Mark the subscription as cancelled. | |
onGracePeriod ( ) : boolean | Determine if the subscription is within its grace period after cancellation. | |
onTrial ( ) : boolean | Determine if the subscription is within its trial period. | |
resume ( ) | Resume the cancelled subscription. | |
swap ( string $plan ) | Swap the subscription to a new Braintree plan. | |
user ( ) | Get the user that owns the subscription. | |
valid ( ) : boolean | Determine if the subscription is active, on trial, or within its grace period. |
Method | Description | |
---|---|---|
currentDiscounts ( ) : array | Get the current discounts for the subscription. | |
getDiscountForSwitchToMonthly ( BraintreePlan $currentPlan, BraintreePlan $plan ) : object | Get the discount to apply when switching to a monthly plan. | |
getDiscountForSwitchToYearly ( ) : object | Get the discount to apply when switching to a yearly plan. | |
moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float | Calculate the amount of discount to apply to a swap to monthly billing. | |
swapAcrossFrequencies ( string $plan ) | Swap the subscription to a new Braintree plan with a different frequency. | |
switchingToMonthlyPlan ( BraintreePlan $currentPlan, BraintreePlan $plan ) : boolean | Determine if the user is switching form yearly to monthly billing. | |
wouldChangeBillingFrequency ( string $plan ) : boolean | Determine if the given plan would alter the billing frequency. |
public applyCoupon ( $coupon, $removeOthers = false ) | ||
$coupon | ||
$removeOthers |
public asBraintreeSubscription ( ) : Braintree\Subscription | ||
return | Braintree\Subscription |
protected currentDiscounts ( ) : array | ||
return | array |
protected getDiscountForSwitchToMonthly ( BraintreePlan $currentPlan, BraintreePlan $plan ) : object | ||
$currentPlan | BraintreePlan | |
$plan | BraintreePlan | |
return | object |
protected getDiscountForSwitchToYearly ( ) : object | ||
return | object |
public markAsCancelled ( ) : void | ||
return | void |
protected moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float | ||
$plan | BraintreePlan | |
return | float |
public onGracePeriod ( ) : boolean | ||
return | boolean |
protected swapAcrossFrequencies ( string $plan ) | ||
$plan | string |
protected switchingToMonthlyPlan ( BraintreePlan $currentPlan, BraintreePlan $plan ) : boolean | ||
$currentPlan | BraintreePlan | |
$plan | BraintreePlan | |
return | boolean |
protected wouldChangeBillingFrequency ( string $plan ) : boolean | ||
$plan | string | |
return | boolean |
protected array $dates | ||
return | array |
protected array $guarded | ||
return | array |