GithubHelp home page GithubHelp logo

troopers / mangopaybundle Goto Github PK

View Code? Open in Web Editor NEW
27.0 13.0 19.0 707 KB

Mangopay api implementation for Symfony

Home Page: http://troopers.agency

License: MIT License

PHP 85.82% JavaScript 9.49% HTML 4.68%
symfony symfony-bundle mangopay mangopay-api troopers

mangopaybundle's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.