Download the PHP package ptuchik/billing without Composer
On this page you can find all versions of the php package ptuchik/billing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ptuchik/billing
More information about ptuchik/billing
Files in ptuchik/billing
Package billing
Short Description Billing package for Laravel 5.5 supporting packages, plans, coupons, addons, payments and subscriptions
License MIT
Informations about the package billing
Billing
WARNING!!! If you are already using v1.x version, please stay on it, v2.x may have some backward incompatibilities...
Sell anything for everything...
Billing package for Laravel 5.5+ supporting packages, plans, coupons, addons, payments and subscriptions with multi currencies
Structure:
The structure is the following:
- Billable - Model that will pay for everything
- Hostable - Model for which can be purchased everything
- Package - Model that can be purchased
- Plan - Model that will sell the Package
- Reference - Can be any model, that will be purchased with Package
- Coupon - Discount, which can be applied on Plan purchase
Concept
The concept is the following:
To be able to use this package, firstly you need to add Billable
trait to your billable model and implement Billable
interface (usually it is User model).
Hostable models have to implement Hostable
interface and use Hostable
trait, which will add Purchases relation to model.
All packages have to be extended from PackageModel abstract class.
That's it!
P. S. Everything is overridable from configuration, provided by package
Installation
After composer installation, just run php artisan migrate
as usual, to have the additional tables added to your database and publish configurations by executing:
IMPORTANT! Your billable model has to have the following attributes:
balance
- cast: numericpaymentGateway
- cast: stringpaymentProfiles
- cast: arraycurrency
- cast: stringparams
- cast: array
and isTester()
method, which will indicate if your billable model is tester or customer, to set the correct mode of payment gateway environment. If you don't need testers, you can just create the following method in your billable model:
Usage
To get the plan details, with trial days calculation and summary (all coupons and available balance discounts applied) for current user on current host, just call:
To purchase the plan, just call:
Documentation
Coming soon...
Special thanks to
- Laravel
- Currencies
- Translatable package
- The League of Extraordinary Packages for Omnipay - multi-gateway payment processing library
All versions of billing with dependencies
ptuchik/core-utilities Version ^1.0
league/omnipay Version ^3.0
ptuchik/braintree Version 1.1.6
torann/currency Version ^1.0
ucraft-com/detection Version ^1.2