Receiving payments via online payment systems
Using bePaid API allows you to organize all supported payment systems (that are continuously increasing) after a one-time configuration.
To work with online payment systems you need to send a request to bePaid API. Regardless of request type (request to receive payment or request for payment status or something else) each request to API must meet the following requirements:
- to use HTTP Basic authentication with Shop ID and Secret Key;
- to contain headers
- to have a JSON body.
Regardless of the payment method, the basic algorithms for making the payment are standard. They require sending specific requests in specific formats, processing received responses and processing of callbacks. In the standard case, regardless of the used payment method and payment details, to make a request you need:
To send the appropriate request to bePaid API and receive a response.
If request data are correct and payment can be directly executed bePaid API returns successful or failed and creates webhook (callback) to URL from
notification_urlparameter and shows the payment result of payment in merchant's backoffice;
If request data are correct, but the payment cannot be executed directly bePaid API returns a response with a pending status and a form with fields for redirecting the user to the online payment method site. By using the received fields you must create a web form for the user and after submitting this form the user will be redirected to the payment method site where he(she) can make the payment. When the user is on the payment method site, bePaid waits for system notification about changing payment status.
When the status is finally changed, callback to URL from
notification_urlparameter (if presented) sends with all the information about the made payment (you can find more information about webhooks (callbacks) at payment notification document). If there was no
notification_urlparameter in the request, callback is not sent and payment result can be requested by uid .
After finishing the payment on the site of the payment method, the user returns to bePaid and is then redirected to your site or mobile application to the URL sent in
When your shop handles appropriate callbacks, we recommend you to request a payment status by uid and depending on the received status, you can show to the user what is going on with the payment. If bePaid API returns a pending status this means that the user is still on the online payment method site, the payment has not made and you need to repeat your request after some time.
See the description of each transaction type for detailed information about the request and response methods and schemes.