Sample-creativemarkeplace: Difference between revisions

From Barion Documentation
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{PageTitle|title=Creative marketplace - C2C sample}} Ez a példa egy olyan piacteret mutat be, ahol egy vásárló fizet több kézműves eladónak, akik a piacté...")
 
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 2: Line 2:
{{PageTitle|title=Creative marketplace - C2C sample}}
{{PageTitle|title=Creative marketplace - C2C sample}}


Ez a példa egy olyan piacteret mutat be, ahol egy vásárló fizet több kézműves eladónak, akik a piactéren árulnak, és amiből a piactér részesedik 10-10%-ot.
This example is the input of <span class="api-ver">v2</span> [[Payment-Start-v2|/Payment/Start]] API call for an online marketplace, where customers can shop creative crafts (beer mug and hand made jewelry) from different vendors and the marketplace receives a 10% commission from each vendor. The API call is initiated by the marketplace, as the facilitator. Read more about [[C2C_Payments|C2C Payments]] and review transaction and API mappings.


'''Bemenet'''
'''API Input JSON'''
<source lang="javascript">
<source lang="javascript">
{
{
Line 12: Line 12:
     PaymentRequestId: "fa-01",
     PaymentRequestId: "fa-01",
     PayerHint: "[email protected]",
     PayerHint: "[email protected]",
     Locale: "hu-HU",
     Locale: "en-US",
     Currency: "HUF",
     Currency: "EUR",
     FundingSources: [
     FundingSources: [
         "All"
         "All"
Line 20: Line 20:
         {
         {
             POSTransactionId: "fa-01-01",
             POSTransactionId: "fa-01-01",
             Payee: "fazekas@example.com",
             Payee: "potter@example.com",
             Total: 5000,
             Total: 50,
             //Immediately after crediting 5000 Ft to fazekas@example.com, 500 Ft will be sent to the marketplace.
             //Immediately after crediting €50 to potter@example.com, €5 will be sent to the marketplace.
             PayeeTransactions: [
             PayeeTransactions: [
                 {
                 {
                     POSTransactionId: "TR-01-01-01",
                     POSTransactionId: "TR-01-01-01",
                     Payee: "[email protected]",
                     Payee: "[email protected]",
                     Total: 500,
                     Total: 5,
                     Comment: "Marketplace facilitation fee: TR-01-01-01."
                     Comment: "Marketplace commission: TR-01-01-01."
                 },
                 },
             ],
             ],
             Items: [
             Items: [
                 {
                 {
                     Name: "Görbe bögre",
                     Name: "Beer mug",
                     Description: "Kézműves görbe bögre, 2dl, kerámia ",
                     Description: "Artisan beer mug, 1L, pottery ",
                     Quantity: 1,
                     Quantity: 1,
                     Unit: "db",
                     Unit: "db",
                     UnitPrice: 5000,
                     UnitPrice: 50,
                     ItemTotal: 5000,
                     ItemTotal: 50,
                     SKU: ""
                     SKU: ""
                 },
                 },
Line 45: Line 45:
         {
         {
             POSTransactionId: "fa-01-02",
             POSTransactionId: "fa-01-02",
             Payee: "bicskas@example.com",
             Payee: "jeweler@example.com",
             Total: 3000,
             Total: 30,
             //Immediately after crediting 3000 Ft to bicskas@example.com, 300 Ft will be sent to the marketplace.
             //Immediately after crediting €30 to jeweler@example.com, €3 will be sent to the marketplace.
             PayeeTransactions: [
             PayeeTransactions: [
                 {
                 {
                     POSTransactionId: "TR-01-02-01",
                     POSTransactionId: "TR-01-02-01",
                     Payee: "[email protected]",
                     Payee: "[email protected]",
                     Total: 300,
                     Total: 3,
                     Comment: "Marketplace facilitation fee: TR-01-02-01."
                     Comment: "Marketplace commission: TR-01-02-01."
                 },
                 },
             ],
             ],
             Items: [
             Items: [
                 {
                 {
                     Name: "Bugylibicska",
                     Name: "Necklace",
                     Description: "Fa nyelű bicska, 8 cm pengével, bőr tokkal ",
                     Description: "Hand made copper necklace with glass decor",
                     Quantity: 1,
                     Quantity: 1,
                     Unit: "db",
                     Unit: "db",
                     UnitPrice: 3000,
                     UnitPrice: 30,
                     ItemTotal: 3000,
                     ItemTotal: 30,
                     SKU: ""
                     SKU: ""
                 },
                 },
Line 73: Line 73:
</source>
</source>


<!-- This is a comment
==== me ====


'''Bemenet'''
[[CodeSamples|More Code Samples]]
<source lang="javascript">
{
    POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
    PaymentType: "Immediate",           
    PaymentWindow: "00:30:00",
 
    GuestCheckout : "True",
    FundingSources: [ "All" ],   
 
    PaymentRequestId: "payment-24",
    OrderNumber: "n/a",
    PayerHint: "[email protected]",
 
    RedirectUrl: "http://barion.me/system/successful-payment",
    CallbackUrl: "http://barion.me/system/callback",
 
    Locale: "en-US",
    Currency: "HUF",
 
    Transactions: [
        {
            POSTransactionId: "payment-24-1",
            Payee: "[email protected]",
            Total: 5000,
            PayeeTransactions: [
                {
                    POSTransactionId: "payment-24-1-1",
                    Payee: "[email protected]",
                    Total: 50,
                    Comment: "Barion me commission: payment-24-1-1"
                },
            ],
            Items: [
                {
                    Name: "Yesterday's beer.",
                },
            ]
        }
    ]
}
</source>

Latest revision as of 13:11, 20 February 2019

Creative marketplace - C2C sample

This example is the input of v2 /Payment/Start API call for an online marketplace, where customers can shop creative crafts (beer mug and hand made jewelry) from different vendors and the marketplace receives a 10% commission from each vendor. The API call is initiated by the marketplace, as the facilitator. Read more about C2C Payments and review transaction and API mappings.

API Input JSON

{
    POSKey: "999FFDDA-04FF-333F-CCCC-345FCB555FFC",
    PaymentType: "Immediate",             
    PaymentWindow: "00:30:00",
    PaymentRequestId: "fa-01",
    PayerHint: "[email protected]",
    Locale: "en-US",
    Currency: "EUR",
    FundingSources: [
        "All"
    ],
    Transactions: [
        {
            POSTransactionId: "fa-01-01",
            Payee: "[email protected]",
            Total: 50,
            //Immediately after crediting €50 to [email protected], €5 will be sent to the marketplace.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-01-01",
                    Payee: "[email protected]",
                    Total: 5,
                    Comment: "Marketplace commission: TR-01-01-01."
                },
            ],
            Items: [
                {
                    Name: "Beer mug",
                    Description: "Artisan beer mug, 1L, pottery ",
                    Quantity: 1,
                    Unit: "db",
                    UnitPrice: 50,
                    ItemTotal: 50,
                    SKU: ""
                },
            ]
        },
        {
            POSTransactionId: "fa-01-02",
            Payee: "[email protected]",
            Total: 30,
            //Immediately after crediting €30 to [email protected], €3 will be sent to the marketplace.
            PayeeTransactions: [
                {
                    POSTransactionId: "TR-01-02-01",
                    Payee: "[email protected]",
                    Total: 3,
                    Comment: "Marketplace commission: TR-01-02-01."
                },
            ],
            Items: [
                {
                    Name: "Necklace",
                    Description: "Hand made copper necklace with glass decor",
                    Quantity: 1,
                    Unit: "db",
                    UnitPrice: 30,
                    ItemTotal: 30,
                    SKU: ""
                },
            ]
        }

    ]
}


More Code Samples