Marketplace Example

From Barion Documentation
Revision as of 11:47, 20 December 2017 by Vinczei (talk | contribs)
Jump to navigation Jump to search

Example of a marketplace pamyent

This guide's purpose to show an immediate payment process including a facilitator, from end to end.

In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.

The process starts with the shopping part. The user select products on a given site. These products belongs to manufacturers ( other "users" of the system), therefore the prices of their products will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system. The demo products will be the followings ( including the manufacturers):


The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API (/Payment/Start). Two transactions will be specified, with the manufacturers set as payees. For this specific payment the required JSON file would look like this :

 
{
    "POSKey": "60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17",
    "PaymentType": "Immediate",
    "PaymentRequestId": "TEST-01",
    "GuestCheckOut" : true,
    "FundingSources": ["All"],
    "Locale":"en-US",
    "Currency":"EUR",
    "Transactions": [
        {
            "POSTransactionId": "TEST-01-01",
            "Payee": "[email protected]",
            "Total": "49",
            "Comment": "Order 1",
            "Items": [
                {
                    "Name": "Fresh potatoes",
                    "Description": "Fresh potatoes",
                    "Quantity": 3,
                    "Unit": "kg",
                    "UnitPrice": 3,
                    "ItemTotal": 9,
                    "SKU": "SM-01"
                },
                {
                    "Name": "Ginger, sliced",
                    "Description": "Ginger, sliced",
                    "Quantity": 2,
                    "Unit": "packs",
                    "UnitPrice": 10,
                    "ItemTotal": 20,
                    "SKU": "SM-02"
                },
                {
                    "Name": "Truffle box",
                    "Description": "Truffle box",
                    "Quantity": 1,
                    "Unit": "pc",
                    "UnitPrice": 20,
                    "ItemTotal": 20,
                    "SKU": "SM-03"
                }
            ]
        },
        {
            "POSTransactionId": "TEST-01-02",
            "Payee": "[email protected]",
            "Total": "35",
            "Comment": "Order  2",
            "Items": [
                {
                    "Name": "8 piece kitchen knives set",
                    "Description": "8 piece kitchen knives set",
                    "Quantity": 1,
                    "Unit": "pc",
                    "UnitPrice": 35,
                    "ItemTotal": 35,
                    "SKU": "SM-04"
                }
            ]
        }
    ]
}
WARNING
Do NOT copy this JSON to your project without modifications, this is for demo purposes only.


If the prepare is done, the user will be redirected to the following page:

File:Marketplace payment example.png

The customer will see the payee is the facilitators, while the sellers are the manufacturers.


At this point they can choose from paying using either with their Barion wallet or with bank card. If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:

In case of bank card payment, they need to fill the required card datas and their email address.

When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.

If the payment is successfully finished, they will be redirected to the following page:

File:Marketplace payment finish.png


After a short period of time, the user be redirected back to the shop's site (the RerdirectUrl can be specified at the Payment Start). Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).

Reference