Download the PHP package finller/laravel-mangopay without Composer
On this page you can find all versions of the php package finller/laravel-mangopay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download finller/laravel-mangopay
More information about finller/laravel-mangopay
Files in finller/laravel-mangopay
Package laravel-mangopay
Short Description mangopay as service provider
License MIT
Homepage https://github.com/finller/laravel-mangopay
Informations about the package laravel-mangopay
Mangopay package for Laravel
This package allow you to use mangopay api with your Model. The goal is to makes the api more natural and user friendly to use. Under the hood, it uses the mangopay official php sdk.
IMPORTANT: This package only provide Direct Debit PayIn with SEPA mandate for the moment. If you want to do credit card PayIn you can to use the service provider which is the php mangopay sdk
Just had a trait to your model
And then, you have plenty of functions to work easily with mangopay.
It also provide a Service : MangopayServiceProvider, so you can have access to the mangopay sdk if you need.
Installation
Install the package via composer:
You have to publish and run the migrations with:
You have to publish the config file with:
This is the content of the published config file: A temporary folder has to be specified as well as api credentials.
Usage
Setup your Model
This package works with a Trait, the trait gives you plenty of functions and most of all it makes a link between your database and the mangopay data.
You can use the trait on any Model, not just User.
By default, the mangopay user is LEGAL. You can define if your user is NATURAL (a person) or LEGAL (a company or an organization) like that:
If you already store the data of your users in your database and you want to sync it with mangopay, just add:
These data will be used when you call $user->createMangopayUser();
or $user->updateMangopayUser();
.
In the exemple, all personnal data needed by Mangopay are fetch from your Model. Please note that the only information stored by this package in the database are the mangopay user id and the mangopay user KYC level.
Create and update your mangopay user
Then you can just create and update your mangopay user like that:
If you do not use buildMangopayUserData
method, or if you want to override it, you can pass an array of data:
array from the method buildMangopayUserData
and array passed as variable will be merged.
please note that some fields are mandatory to be able to create a mangopay User (please see to the mangopay docs).
Manage your mangopay wallets
Add Bank account and mandate
There are a lot of functions to manage everything, so don't hesitate to explore the trait (methods names are pretty clear).
Do PayIn and PayOut
IMPORTANT: This package only support Direct Debit PayIn with SEPA mandate for the moment. If you want to do credit card PayIn you have to use the service provider and so the php sdk
Retreive Laravel User and Mangopay User from Mangopay User Id
This situation will happen very often when dealing with Mangopay hooks. You can use the MangopayPivot
Model.
Managing Mangopay Hooks
This is just an example of how you can deal with Mangopay hooks in Laravel.
Setup the route
Define the controller
Define the event
And you can listen to mangopay Hooks !
Deploy in production
By default the mangopay sdk use the sandbox api url. If you want to go in production you have to define the production api url in the config file like this:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Quentin Gabriele
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-mangopay with dependencies
spatie/laravel-package-tools Version ^1.11
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0
illuminate/contracts Version ^5.0|^6.0|^7.0|^8.0|^9.0
mangopay/php-sdk-v2 Version ^3.7