Download the PHP package perafan/cashier-openpay without Composer
On this page you can find all versions of the php package perafan/cashier-openpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cashier-openpay
CashierOpenpay
Installation
Require the Cashier package for Openpay with Composer:
CashierOpenpay | Laravel |
---|---|
1.X | 7.X |
2.X | 8.X |
Run to publish migrations, WebHookController and config file.
The Cashier service provider registers its own database migration directory, so remember to migrate your database after installing the package. The Cashier migrations will add several columns to your users table as well as create a new subscriptions table to hold all of your customer's subscriptions:
Configuration
Billable Model
Add the Billable
trait to your model definition.
Billable
trait provides methods to allow yo to perform common billing tasks (creating subscriptions, add payment method information, creating charges ,etc.)
Cashier assumes your Billable model will be the App\Models\User class that ships with Laravel. If you wish to change this you can specify a different model in your
.env` file:
API Keys
Next, you should configure your Openpay keys in your .env file. You can retrieve your Openpay API keys from the Openpay control panel.
Environment
By convenience and security, the sandbox mode is activated by default in the client library. This allows you to test your own code when implementing Openpay, before charging any credit card in production environment.
Logging
Cashier allows you to specify the log channel to be used when logging all Openpay related exceptions.
Show openpay errors (Optional)`
If you want to catch all the openpay exceptions add in your app/Exceptions/Handler.php
To render the error response in blade you could use the follow snippets.
Show errors with bootstrap
Show errors with tailwindcss
Your own Openpay Exceptions Handler (Optional)
You can modify the response creating your own handler.
Use
Customers
On a User:
Add a new customer to a merchant:
`
Get a customer:
Update a customer:
Delete a customer:
On a merchant:
Add a new customer to a merchant:
`
Get a customer:
Get the list of customers:
Update a customer:
Delete a customer:
Cards
On a user:
Add a card:
Get a card:
Get user cards:
Get user cards from Openpay
Delete a card
On a merchant:
Add a card:
Get a card:
Get the list of cards:
Delete a card:
Bank Accounts
Add a bank account to a customer:
Get a bank account
Get user bank accounts:
Get user bank accounts from Openpay:
Delete a bank account:
Charges
On a Customer:
Make a charge on a customer:
Get a charge:
Get list of charges per user:
Make a capture:
Make a refund:
On a Merchant:
Make a charge on a merchant:
Get a charge:
Get list of charges:
Make a capture:
Make a refund:
Transfers
Make a transfer:
Get a transfer:
Get list of transfers:
Payouts
On a Customer:
Make a payout on a customer:
Get a payout:
Get list pf payouts:
Fees
Pending ...
Plans
Add a plan:
Get a plan:
Get list of plans:
Update a plan:
Delete a plan:
Get list of subscriptors of a plan:
Subscriptions
Add a subscription:
Checking Subscription Status
Subscription Trial
Checking User Trial
Get a subscription:
Get list of subscriptions:
Update a subscription:
Delete a subscription:
Openpay SDK
Many of Cashier's objects are wrappers around Openpay SDK objects. If you would like to interact with the Openpay objects directly, you may conveniently retrieve them using the asOpenpay...
methods:
Testing
To get started, add the testing version of your Openpay keys to your phpunit.xml file:
Then you can run on your term
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.