This bundle provides integration of the official SDK PHP for Mangopay api V2 into Symfony.
app_ventus_mangopay:
client_id: your_mangopay_client_id
client_password: your_mangopay_client_password
base_url: your_mangopay_base_url
The official sdk provides a "MangoMapApi" class which is a shortcut to all the "tools" like "ApiPayIns", "ApiWallets", "ApiUsers"... You can access those "tools" through the service "appventus_mangopay.mango_api".
$payIn = new PayIn();
$this->get('appventus_mangopay.mango_api')->PayIns->create($payIn);
Additionnaly, there is some helpers that handle most of the mangopay actions. fell free to fork and implement yours
It can register user BankInformations as it implements BankInformationInterface
$bankInformation = new BankInformation();
$this->get('appventus_mangopay.bank_information_helper')->createBankAccount($bankInformation);
It can register a CardPreauthorisation and execute it
$cardRegistration = new CardRegistration();
$this->get('appventus_mangopay.payment_helper')->createPreAuthorisation($cardRegistration);
$cardPreAuthorisation = new CardPreAuthorisation();
$this->get('appventus_mangopay.payment_helper')->executePreAuthorisation($cardPreAuthorisation, $user, $wallet);
It can create a new direct payment
$transaction = new Transaction();
$this->get('appventus_mangopay.payment_direct_helper')->createDirectTransaction($transaction);
It can create a new user in mangopay as the User object implements the UserInterface
$user = new User();
$this->get('appventus_mangopay.user_helper')->createMangoUser($user);
It can create a user wallet
$user = new User();
$this->get('appventus_mangopay.wallet_helper')->createWalletForUser($user);
This is the general workflow for the mangopay payment page:
- Displaying the payment form to user
- Create mangopay user and the card registration through mangopay API