Sample-uber

From Barion Documentation
Revision as of 21:24, 4 September 2017 by Birot (talk | contribs)
Jump to navigation Jump to search

Car sharing 'Uber' style - C2C sample

This example is the input of v2 /Payment/Start API call for a car sharing 'Uber' style service, where passengers pay a fee for rides to drivers, and the app provider receives a fee. The API call is initiated by the app provider, as the facilitator. Read more about C2C Payments and review transaction and API mappings. Also read more about Token payments.

API Input JSON

{
    POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
    PaymentType: "Immediate",             
    PaymentWindow: "00:30:00",
    PaymentRequestId: "fa-01",

    InitiateRecurrence : "False", 
    RecurrenceId : "345986-25646-3456346", //Payment automatically made after ride using Token

    PayerHint: "[email protected]",
    Locale: "en-US",
    Currency: "USD",
    FundingSources: [
        "All"
    ],
    Transactions: [
        {
            POSTransactionId: "fa-01-01",
            Payee: "[email protected]",
            Total: 50,
            //Immediately after crediting $50 to driver, $5 will be sent to the app provider.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-01-01",
                    Payee: "[email protected]",
                    Total: 5,
                    Comment: "Car sharing commission: TR-01-01-01."
                },
            ],
            Items: [
                {
                    Name: "Car sharing ride",
                    Description: "Ride from 23 Lucky road, Queens to 456 Broadway, Manhattan",
                    Quantity: 20,
                    Unit: "miles",
                    UnitPrice: 2.5,
                    ItemTotal: 50,
                    SKU: ""
                },
            ]
        }
    ]
}

More Code Samples