Experimental project
This is a sandbox project, which contains experimental code for developer use only.
This module integrates MangoPay with Funds submodule of Commerce Marketplace project.
Intro
This module fully integrates Commerce Marketplace Funds with MangoPay Payments.
It supports deposit, transfer, payment and withdraw transactions.
MangoPay transactions are duplicated on Drupal database for making things
faster, but queries are made to MangoPay to validate local data before doing
sensitive operations like transfers or payments.
Under the hoods
The module provides two new Commerce Payment Methods:
- MangoPay Payment Method
This is an offsite payment method which redirects the user to MangoPay
for handling the payment.
Once the user makes an offsite payment, her credit card information is saved
in MangoPay, and she'll be able to use One Click Payments for her later
orders. To make this possible, the module asks MangoPay to make a
contribution transaction from the user credit cart to her (newly created)
MangoPay e-wallet and then transfers the money from the e-wallet to the
website e-wallet when she's redirected back to the website from MangoPay. - MangoPay One Click Payment
Once the user has made a payment using the offsite MangoPay Payment Method,
She'll be able to utilize One Click Payments by selecting one of her credit
cards that MangoPay has saved in her previous offsite payments. This time,
the module asks MangoPay to charge the customer credit card and transfer the
money directly to the website's MangoPay account.
MangoPay needs Email, First name, Last name, Nationality, and Person type to
create new e-wallets for users. Therefore, this module adds the following
fields to Marketplace Funds Account owner entity types (e.g. user and
commerce_store entity types by default):
- cmp_mango_fname
- cmp_mango_lname
- cmp_mango_nationality
- cmp_mango_person_type
It also adds `mango_user_id' field to the Marketplace Funds Account entity type
itself.
To keep track of MangoPay transactions in Drupal, we save payer (originator) and
beneficiary (destination) account ids on transactions in `payer_id' and
`beneficiary_id' fields on the Marketplace Funds Transaction entities.
To handle withdraw requests, the module creates a new Funds Withdraw Method
bundle, named 'MangoPay', with the following fields:
- mango_bank_account_owner_name
- mango_bank_account_owner_address
- mango_bank_account_iban
- mango_bank_account_bic
- mango_beneficiary_id
When the Funds Account owner creates her instance of this withdraw method,
A request is made to MangoPay to register this withdraw method for her and
saves the withdraw method id in `mango_beneficiary_id' field which is used
later for creating Commerce Marketplace Funds Withdraw Transactions.
Funds Withdraw Transactions are created in Pending status and are not sent to
MangoPay until their status is changed to "Success". You can do this manually,
or using Rules Scheduler to process withdraw requests at predefined time periods
automatically.
Configuration
Module configuration form can be found at admin/commerce/mangopay.
If you already have a MangoPay e-wallet that you want to use with this module,
check "I have a Mangopay account" checkbox and enter your MangoPay User ID and
Wallet ID. Otherwise enter your first name, last name, email address and person
type and the module will create a MangoPay account and e-wallet for you which
will be used as the master account for the marketplace.
Project information
- Created by farhadhf on , updated

