PHP 클래스 Laravel\Cashier\Subscription

상속: extends Illuminate\Database\Eloquent\Model
파일 보기 프로젝트 열기: laravel/cashier-braintree 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$dates array The attributes that should be mutated to dates.
$guarded array The attributes that aren't mass assignable.

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
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.

메소드 상세

active() 공개 메소드

Determine if the subscription is active.
public active ( ) : boolean
리턴 boolean

applyCoupon() 공개 메소드

* Apply a coupon to the subscription.
public applyCoupon ( $coupon, $removeOthers = false )
$coupon
$removeOthers

asBraintreeSubscription() 공개 메소드

Get the subscription as a Braintree subscription object.
public asBraintreeSubscription ( ) : Braintree\Subscription
리턴 Braintree\Subscription

cancel() 공개 메소드

Cancel the subscription.
public cancel ( )

cancelNow() 공개 메소드

Cancel the subscription immediately.
public cancelNow ( )

cancelled() 공개 메소드

Determine if the subscription is no longer active.
public cancelled ( ) : boolean
리턴 boolean

currentDiscounts() 보호된 메소드

Get the current discounts for the subscription.
protected currentDiscounts ( ) : array
리턴 array

getDiscountForSwitchToMonthly() 보호된 메소드

Get the discount to apply when switching to a monthly plan.
protected getDiscountForSwitchToMonthly ( BraintreePlan $currentPlan, BraintreePlan $plan ) : object
$currentPlan BraintreePlan
$plan BraintreePlan
리턴 object

getDiscountForSwitchToYearly() 보호된 메소드

Get the discount to apply when switching to a yearly plan.
protected getDiscountForSwitchToYearly ( ) : object
리턴 object

markAsCancelled() 공개 메소드

Mark the subscription as cancelled.
public markAsCancelled ( ) : void
리턴 void

moneyRemainingOnYearlyPlan() 보호된 메소드

Calculate the amount of discount to apply to a swap to monthly billing.
protected moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float
$plan BraintreePlan
리턴 float

onGracePeriod() 공개 메소드

Determine if the subscription is within its grace period after cancellation.
public onGracePeriod ( ) : boolean
리턴 boolean

onTrial() 공개 메소드

Determine if the subscription is within its trial period.
public onTrial ( ) : boolean
리턴 boolean

resume() 공개 메소드

Resume the cancelled subscription.
public resume ( )

swap() 공개 메소드

Swap the subscription to a new Braintree plan.
public swap ( string $plan )
$plan string

swapAcrossFrequencies() 보호된 메소드

Swap the subscription to a new Braintree plan with a different frequency.
protected swapAcrossFrequencies ( string $plan )
$plan string

switchingToMonthlyPlan() 보호된 메소드

Determine if the user is switching form yearly to monthly billing.
protected switchingToMonthlyPlan ( BraintreePlan $currentPlan, BraintreePlan $plan ) : boolean
$currentPlan BraintreePlan
$plan BraintreePlan
리턴 boolean

user() 공개 메소드

Get the user that owns the subscription.
public user ( )

valid() 공개 메소드

Determine if the subscription is active, on trial, or within its grace period.
public valid ( ) : boolean
리턴 boolean

wouldChangeBillingFrequency() 보호된 메소드

Determine if the given plan would alter the billing frequency.
protected wouldChangeBillingFrequency ( string $plan ) : boolean
$plan string
리턴 boolean

프로퍼티 상세

$dates 보호되어 있는 프로퍼티

The attributes that should be mutated to dates.
protected array $dates
리턴 array

$guarded 보호되어 있는 프로퍼티

The attributes that aren't mass assignable.
protected array $guarded
리턴 array