External Payment API

Question:
Is it possible to use an external API to securely accept payments?

Product:
Wix Editor

What are you trying to achieve:
I have a website for a business based in Belize. PayPal and Stripe aren’t available for a lot of Belizeans based on banking restrictions, etc. There’s a new company that allows Belizeans to accept international payments. It’s called One Link Mobile and they use an API to allow Belizeans to accept international payments on a website.

Additional information:
Documentation from One Link support is as follows:

Introduction:
Welcome to the OneLink API documentation. This comprehensive guide is crafted to be an invaluable tool for developers of all levels. It aims to assist in maximizing the efficacy of our robust Application Programming Interface (API). From seasoned professionals to those just embarking on their development journey, this resource is designed to provide the essential details for seamlessly integrating the OneLink API and tapping into the myriad of features our platform offers.

Endpoint URLs:

Request Structure:
API requests should adhere to the following guidelines:

  • Use a POST request method.
  • Structure the payload in JSON format.

Sample Request:
{
“token”: “access_token”,
“nameOnCard”: “John Doe”,
“cardNumber”: “1111222233334444”,
“expirationDate”: “09/24”,
“ccv”: “123”,
“amount”: “1”
}

Response Format
{
“msg”: “51: INSUFF FUNDS”
}

Authentication:
Upon user registration, an authentication token will be dispatched to the email address provided. This token will be instrumental in facilitating secure API interactions.

Yes, it is possible to use an external API like OneLink Mobile’s API to securely accept payments on your Wix website. However, Wix does not provide built-in functionality to directly integrate with third-party payment gateways or APIs. Instead, you’ll need to use a combination of Wix’s built-in features and custom code to achieve this integration.

Here’s a general approach you can take:

Create a Payment Form on Wix

  • Use Wix’s built-in form builder to create a payment form that collects the necessary information required by the OneLink Mobile API, such as the card number, expiration date, CCV, and amount.

Add Custom Code to Handle Form Submission

  • Use Wix Code (Wix’s built-in development platform) to create a custom function that handles the form submission.

  • This function should gather the form data and construct the appropriate JSON payload required by the OneLink Mobile API.

Send Payment Request to OneLink Mobile API

  • Within your custom function, use Wix’s built-in wix-fetch module to send a POST request to the OneLink Mobile API endpoint with the constructed JSON payload.

  • Include the authentication token provided by OneLink Mobile in the request headers.

Handle API Response

  • In your custom function, handle the response from the OneLink Mobile API.

  • Based on the response, you can display appropriate messages or take further actions on your Wix website.

Secure Your Code

  • Ensure that sensitive information, such as the authentication token and card details, are stored and handled securely within your Wix Code.

  • Consider using Wix’s my sedgwick built-in secure storage options or implementing additional security measures as needed.

Keep in mind that integrating with external APIs on Wix involves writing custom code, which requires some familiarity with JavaScript and Wix’s development platform. Additionally, you’ll need to ensure that your implementation complies with any requirements or guidelines provided by OneLink Mobile.

If you’re not comfortable with writing custom code or need more advanced functionality, you may want to consider hiring a Wix developer or exploring third-party payment integration solutions specifically designed for Wix websites.

1 Like

Can you provide more details on the expected request structure and response format for the OneLink Mobile API? The documentation includes sample JSON payloads, but I want to make sure I understand the required fields basket random and response formats correctly.

This is all I have for now. The question was asked for a client who ended up not implementing OneLink, so I haven’t tested it yet. That said, support at info@onelink.bz was very helpful. Hope you’re able to get more answers there.