Developed with love by KnpLabs Hire us for your project!
43

MangopayBundle

by Troopers

Mangopay api implementation for Symfony

Troopers

Gitter
License
Version
Packagist DL
SensioLabsInsight

Twitter Follow

MangopayBundle

Description

This bundle provides integration of the official SDK PHP for Mangopay api V2 into Symfony.

Configuration

troopers_mangopay:
    client_id: your_mangopay_client_id
    client_password: your_mangopay_client_password
    base_url: your_mangopay_base_url

How to use it ?

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 "troopers_mangopay.mango_api".

    $payIn = new PayIn();
    $this->get('troopers_mangopay.mango_api')->PayIns->create($payIn);

Helpers

Additionnaly, there is some helpers that handle most of the mangopay actions. Feel free to fork and implement yours.

BankInformationHelper

It can register user BankInformations as it implements BankInformationInterface

    $bankInformation = new BankInformation();
    $this->get('troopers_mangopay.bank_information_helper')->createBankAccount($bankInformation);

PaymentHelper

It can register a CardPreauthorisation and execute it

    $cardRegistration = new CardRegistration();
    $this->get('troopers_mangopay.payment_helper')->createPreAuthorisation($cardRegistration);

    $cardPreAuthorisation = new CardPreAuthorisation();
    $this->get('troopers_mangopay.payment_helper')->executePreAuthorisation($cardPreAuthorisation, $user, $wallet);

PaymentDirectHelper

It can create a new direct payment

    $transaction = new Transaction();
    $this->get('troopers_mangopay.payment_direct_helper')->createDirectTransaction($transaction);

UserHelper

It can create a new user in mangopay as the User object implements the UserInterface

    $user = new User();
    $this->get('troopers_mangopay.user_helper')->createMangoUser($user);

WalletHelper

It can create a user wallet

    $user = new User();
    $this->get('troopers_mangopay.wallet_helper')->createWalletForUser($user);

General workflow

This is the general workflow for the mangopay payment page:

  1. Displaying the payment form to user

Step 1

  1. Create mangopay user and the card registration through mangopay API

Step 2

  1. Call the tokenisation server to validate the user credit card, use 3d secure if needed, update the CardR egistration with tokenized Card, create the PreAuthorisation then redirect the user to success page. Step 3
troopers_mangopay:
sandbox_mode: false
debug_mode: false
client_id: ~ # Required
client_password: ~ # Required
base_url: ~ # Required
  • Merge pull request #70 from Troopers/feature/wallet-transfer
    By web-flow, 1 year ago
  • Merge pull request #72 from alexislefebvre/patch-1
    By web-flow, 1 year ago
  • LegalUserHelper: ask validation after file upload
    By alexislefebvre, 1 year ago
  • Update WalletHelper.php
    By web-flow, 1 year ago
  • Merge pull request #71 from alexislefebvre/patch-1
    By web-flow, 1 year ago
  • Add missing import
    By web-flow, 1 year ago
  • add a method to transfer funds between wallets
    By paulandrieux, 1 year ago
  • Merge pull request #69 from Troopers/feature/mandate
    By web-flow, 1 year ago
  • create kyc documents
    By paulandrieux, 1 year ago
  • define getPayout shortcut
    By paulandrieux, 1 year ago
  • php md fixes
    By paulandrieux, 1 year ago
  • create a sandbox mode to inject testing values
    By paulandrieux, 1 year ago
  • inject returnUrl for mandates
    By paulandrieux, 1 year ago
  • use PayInPaymentDetailsDirectDebit with ExecutionDetails
    By paulandrieux, 1 year ago
  • get bank information from user
    By paulandrieux, 1 year ago
  • Merge branch 'feature/mandate' of https://github.com/Troopers/MangopayBundle into feature/mandate
    By paulandrieux, 2 years ago
  • rename getBankAccountId
    By paulandrieux, 2 years ago
  • add getPayin method
    By paulandrieux, 2 years ago
  • inject logger
    By paulandrieux, 2 years ago
  • get a payin
    By paulandrieux, 2 years ago
  • fix typo
    By paulandrieux, 2 years ago
  • add mandate management
    By paulandrieux, 2 years ago
  • update bank informations
    By paulandrieux, 2 years ago
  • Merge pull request #68 from Troopers/feature/legal-user
    By web-flow, 2 years ago
  • do not autowire Form
    By paulandrieux, 2 years ago
  • Merge pull request #67 from Troopers/feature/legal-user
    By web-flow, 2 years ago
  • Inject router interface
    By paulandrieux, 2 years ago
  • Merge pull request #66 from Troopers/feature/legal-user
    By web-flow, 2 years ago
  • remove obsolete class
    By paulandrieux, 2 years ago
  • Merge pull request #65 from Troopers/feature/legal-user
    By web-flow, 2 years ago