PHP Трейт Laravel\Cashier\Billable

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

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

Метод Описание
applyCoupon ( string $coupon, string $subscription = 'default', boolean $removeOthers = false ) : void Apply a coupon to the billable entity.
asBraintreeCustomer ( ) : Customer Get the Braintree customer for the user.
charge ( integer $amount, array $options = [] ) : Transaction Make a "one off" charge on the customer for the given amount.
createAsBraintreeCustomer ( string $token, array $options = [] ) : Customer Create a Braintree customer for the given user.
downloadInvoice ( string $id, array $data, string $storagePath = null ) : Response Create an invoice download Response.
findInvoice ( string $id ) : Invoice | null Find an invoice by ID.
findInvoiceOrFail ( string $id ) : Invoice Find an invoice or throw a 404 error.
hasBraintreeId ( ) : boolean Determine if the entity has a Braintree customer ID.
invoiceFor ( string $description, integer $amount, array $options = [] ) : Transaction Invoice the customer for the given amount.
invoices ( boolean $includePending = false, array $parameters = [] ) : Collection Get a collection of the entity's invoices.
invoicesIncludingPending ( array $parameters = [] ) : Collection Get an array of the entity's invoices.
newSubscription ( string $subscription, string $plan ) : SubscriptionBuilder Begin creating a new subscription.
onGenericTrial ( ) : boolean Determine if the user is on a "generic" trial at the user level.
onPlan ( string $plan ) : boolean Determine if the entity is on the given plan.
onTrial ( string $subscription = 'default', string | null $plan = null ) : boolean Determine if the user is on trial.
subscribed ( string $subscription = 'default', string | null $plan = null ) : boolean Determine if the user has a given subscription.
subscribedToPlan ( array | string $plans, string $subscription = 'default' ) : boolean Determine if the user is actively subscribed to one of the given plans.
subscription ( string $subscription = 'default' ) : Subscription | null Get a subscription instance by name.
subscriptions ( ) : Illuminate\Database\Eloquent\Collection Get all of the subscriptions for the user.
taxPercentage ( ) : integer Get the tax percentage to apply to the subscription.
updateCard ( string $token, array $options = [] ) : void Update customer's credit card.

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

Метод Описание
updateSubscriptionsToPaymentMethod ( string $token ) : void Update the payment method token for all of the user's subscriptions.

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

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

Apply a coupon to the billable entity.
public applyCoupon ( string $coupon, string $subscription = 'default', boolean $removeOthers = false ) : void
$coupon string
$subscription string
$removeOthers boolean
Результат void

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

Get the Braintree customer for the user.
public asBraintreeCustomer ( ) : Customer
Результат Braintree\Customer

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

Make a "one off" charge on the customer for the given amount.
public charge ( integer $amount, array $options = [] ) : Transaction
$amount integer
$options array
Результат Braintree\Transaction

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

Create a Braintree customer for the given user.
public createAsBraintreeCustomer ( string $token, array $options = [] ) : Customer
$token string
$options array
Результат Braintree\Customer

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

Create an invoice download Response.
public downloadInvoice ( string $id, array $data, string $storagePath = null ) : Response
$id string
$data array
$storagePath string
Результат Symfony\Component\HttpFoundation\Response

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

Find an invoice by ID.
public findInvoice ( string $id ) : Invoice | null
$id string
Результат Invoice | null

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

Find an invoice or throw a 404 error.
public findInvoiceOrFail ( string $id ) : Invoice
$id string
Результат Invoice

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

Determine if the entity has a Braintree customer ID.
public hasBraintreeId ( ) : boolean
Результат boolean

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

Invoice the customer for the given amount.
public invoiceFor ( string $description, integer $amount, array $options = [] ) : Transaction
$description string
$amount integer
$options array
Результат Braintree\Transaction

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

Get a collection of the entity's invoices.
public invoices ( boolean $includePending = false, array $parameters = [] ) : Collection
$includePending boolean
$parameters array
Результат Illuminate\Support\Collection

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

Get an array of the entity's invoices.
public invoicesIncludingPending ( array $parameters = [] ) : Collection
$parameters array
Результат Illuminate\Support\Collection

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

Begin creating a new subscription.
public newSubscription ( string $subscription, string $plan ) : SubscriptionBuilder
$subscription string
$plan string
Результат SubscriptionBuilder

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

Determine if the user is on a "generic" trial at the user level.
public onGenericTrial ( ) : boolean
Результат boolean

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

Determine if the entity is on the given plan.
public onPlan ( string $plan ) : boolean
$plan string
Результат boolean

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

Determine if the user is on trial.
public onTrial ( string $subscription = 'default', string | null $plan = null ) : boolean
$subscription string
$plan string | null
Результат boolean

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

Determine if the user has a given subscription.
public subscribed ( string $subscription = 'default', string | null $plan = null ) : boolean
$subscription string
$plan string | null
Результат boolean

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

Determine if the user is actively subscribed to one of the given plans.
public subscribedToPlan ( array | string $plans, string $subscription = 'default' ) : boolean
$plans array | string
$subscription string
Результат boolean

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

Get a subscription instance by name.
public subscription ( string $subscription = 'default' ) : Subscription | null
$subscription string
Результат Subscription | null

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

Get all of the subscriptions for the user.
public subscriptions ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

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

Get the tax percentage to apply to the subscription.
public taxPercentage ( ) : integer
Результат integer

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

Update customer's credit card.
public updateCard ( string $token, array $options = [] ) : void
$token string
$options array
Результат void

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

Update the payment method token for all of the user's subscriptions.
protected updateSubscriptionsToPaymentMethod ( string $token ) : void
$token string
Результат void