Download the PHP package adsy2010/laravel-stripe-wrapper without Composer
On this page you can find all versions of the php package adsy2010/laravel-stripe-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-stripe-wrapper
Laravel Stripe Wrapper
Laravel stripe wrapper intends to take the hassle out of setting up credentials and communicating them to the Stripe API.
To install from composer run the following (this is an alpha release and no automatic versions are available yet)
composer require adsy2010/laravel-stripe-wrapper:v0.0.2-alpha
Add the provider to your service providers array in config/app.php
If you would like to use the full set of migrations without publishing them, add the following service provider to your
service providers array in config/app.php
Finally, publish the migrations
Optionally, you can skip publishing all migrations and run the tag to publish the required migrations
Usage
Credentials
To add an api key to the database, you can run the following:
Note that by default, an added scope is read, if 'w' is specified as the access type, the api key scope will be classified as writable.
If you only wish to use the credentials feature of this package, you may do so by utilising the following code:
This code will retrieve any api key in the database that matches the specified scopes and create
a \Stripe\StripeClient
instance from the stripe/stripe-php
library.
Products
To Create a product on stripe, use the store method
If you would like to utilise the local database when handling stripe products, add true to the end of the statement
To retrieve a product from stripe, use the retrieve method.
There is a retrieve all method which can get all products on stripe in one go optionally storing them. The first argument is a list of parameters to filter by, so for example, all active products is shown below.
If you want to store but not filter all records, you should enter an empty array with true
To update a product in stripe, use the change method.
To delete a product from stripe, use the trash method.
If you add true to the end of a retrieve statement, it will update records in the database from stripe
NOTE: If you want to use a local stripe products table, you should either use the migration provided or use one with the same table name. All methods have an optional store attribute which, if set to true will update a local database version of the product.
Customers
Stripe customers are currently limited on the details that are held locally. Tax id data and payment methods features are not yet implemented. The default payment method ID however is included.
To create a customer on stripe, use the store method
If you would like to utilise the local database when handling stripe customers, add true to the end of the statement
To retrieve a customer from stripe use the retrieve method
There is a retrieve all method which can get all customers on stripe in one go optionally storing them. The first argument is a list of parameters to filter by, so for example, The latest 3 customers are retrieved below.
If you want to store but not filter all records, you should enter an empty array with true
To update a customer in stripe, use the change method
To delete a customer from stripe, use the trash method
NOTE: If you want to use a local stripe customers table, you should either use the migration provided or use one with the same table name. All methods have an optional store attribute which, if set to true will update a local database version of the product.
Payments
Coming soon!