Download the PHP package vovanmix/laravel5-billing-braintree without Composer
On this page you can find all versions of the php package vovanmix/laravel5-billing-braintree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vovanmix/laravel5-billing-braintree
More information about vovanmix/laravel5-billing-braintree
Files in vovanmix/laravel5-billing-braintree
Package laravel5-billing-braintree
Short Description Braintree Service Provider for Laravel 5
License MIT
Homepage https://github.com/vovanmix/laravel5-billing-braintree
Informations about the package laravel5-billing-braintree
Braintree for Laravel 5
Installation
Add to composer.json this line:
"vovanmix/laravel5-billing-braintree": "1.*",
Add to config/app.php "providers" section:
"Vovanmix\Laravel5BillingBraintree\BraintreeServiceProvider",
That's it!
Configuration
To publish a the package configuration file, run in console:
Then open config/billing_braintree.php
to setup your environment and keys
Usage
Obtain a client side token:
Billing::getClientToken()
To use inside Blade template:
{{ Billing::getClientToken() }}
Get summary for the plan
Create customer
Create subscription
Update subscription payment method
Get subscription details
Checks:
Checks can be used to easily get information about subscription state. This methods implement some additional logic, like Past Due handling and Grape Period
Enabled
Most important check. Enabled means that user can still use subscription
Returns True for the following states:
- ACTIVE
- CANCELED (until grace period ends)
- PAST_DUE (if allowed so by config)
Active
Active means that subscription can be used in the future. Canceled and Expired subscriptions cannot be updated.
Returns True for the following states:
- ACTIVE
- PAST_DUE
- PENDING
Successfully Billed
Returns true if there was at least one successful payment in this subscription
Paid
Paid means that this user doesn't owe money for now
Returns True for the following states:
- ACTIVE
- PENDING
Past Due
Returns true if the subscription is past due
Grace period
Grace period can be enabled or disabled in this plugin's config, parameter allowGracePeriod
. It's enabled by default
If it is enabled, after cancelling subscription user can use the subscription until the end of the billing cycle. For example, if the payment date is 10th od each month, and user paid his bill on November 10, and cancelled his subscription on November 11, he still can use the subscription till December 10.
The ability to use the subscription means that checkIfSubscriptionIsEnabled()
method will return TRUE
.
Past Due handling
By default subscriptions with Past Due will be considered Enabled. You have to cancel subscription to them in order to block access
It can be changed in config, parameter allowAccessForPastDue
.
Cancel subscription
All versions of laravel5-billing-braintree with dependencies
illuminate/support Version 5.x
laravel/framework Version 5.x
braintree/braintree_php Version 3.6.x