RESTful API service for pay (npm node-barion)

Dear Community,

I build a wonderful marketplace platform on WIX for dog sitting services where the dog owners hire dog sitters for sitting services :slight_smile:

The main problem is that all of the build up paying services available from Hungary in WIX rejected partnership because the marketplace is too risky Business to be a partner with us. The underwriters have determined that they are unable to underwrite the business for a merchant account.

I starting now to integrate a 3party RESTful API service to accept payments from these transactions with Calling the Barion API (npm node-barion).

Barion offers a RESTful API service to communicate with my web merchant services. The Barion API communicates via standard HTTP1.1 GET or POST requests. A given API endpoint accepts only GET or only POST requests - there are no universal endpoints available. On each API endpoint reference page, you can find the path of the API endpoint and the HTTP method it accepts.

C2C payments - sharing economy and marketplaces
Barion makes it possible for companies to facilitate payments between people or other parties. Hence the name C2C, meaning consumer to consumer. There are roles, as indicated on the diagram.
https://docs.barion.com/C2C_Payments

With npm node-barion I tried to integrate the api but I have a a lot of problem eg. “Cannot find module ‘url’ in ‘node-barion/lib’”

There is possible to integrate RESTful API service to pay in WIX or for paying services I must to use the build up payments?

If it is possible what is the right way?

Here is my first step. I put it on $w . onReady ( function () is just for testing. On the sandbox of the Barion site is everything ok.


$w.onReady(function () {

// 1) Import the 'node-barion' module
const Barion = require('node-barion');

// 2) Instantiate a Barion object
let barion = new Barion({
    POSKey: '21ec20203aea4069a2dd08002b30',
    Environment: 'test'
});

let orderPayment = {
    OrderNumber: 'O-2019-0001',
    PaymentRequestId: 'O-2019-0001-1',
    PaymentType: 'test',
    Transactions: [
        {
            POSTransactionId: 'O-2019-0001',
            Payee: 'info@example.com',
            Total: 1,
            Items: [
                {
                    Name: 'Egg',
                    Description: 'Child of chicken',
                    Quantity: 1,
                    Unit: 'pcs',
                    UnitPrice: 1,
                    ItemTotal: 1
                }    
            ]
        }
    ],
    ShippingAddress: {
        FullName: 'Andrew Jones',
        Zip: '1000',
        City: 'Budapest',
        Street: 'Kossuth Street 2.'
    },
    Currency: 'HUF',
    RedirectUrl: 'https://example.com/payment-result',
    CallbackUrl: 'https://example.com/api/barion/callback/',
};

barion.startPayment(orderPayment).then(data => {
    orderPayment
    console.log(orderPayment)
}).catch(err => {
    //handle error
});

});

I want to stay on WIX because i like it but the payment possibility it makes it very difficult to continue my project.

Error after test:
“Cannot find module ‘url’ in ‘node-barion/lib’”

Sincerely
Istvan

Do NOT post your code with your Key!!

API call with keys should be done on backend, called from Frontend. Import NPM should be on top of onReady.

It seems like this code is just a copy and paste…

You can search “3rd Party Integration” on this forum or google with the keyword “Velo”

Thank you! I’m checking in. It’s a quite different task than I thought. I must learn 3rd Party Integration possibilities.

True