How do I integrate online payments via the API into my website?
Knowledge level for this article: You have already incorporated making a reservation into your website using the API. At this moment you have a reservation number. In addition, you have a set payment environment and you are able to accept payments via the customer pages.
After making a reservation, you want the customer to be able to pay for this reservation immediately. To do this, you must forward the user to the payment provider. This article describes how to prepare this. After all, it is not just a link, but contains (secure) data regarding the reservation and payment.
Follow the manual to create a payment.
A response can look like this:
Reply: { "PSPID": "teqainformatics", "ORDERID": "20093094", "AMOUNT": 37500, "CURRENCY": "EUR", "PARAMVAR": "33388_0", "LANGUAGE": "en", "url": "https://secure.ogone.com/ncol/test/orderstandard.asp", "SHASign": "21E90410DC5E18E405C7C751E08CD96AB9D3CA68E3C3CCDD21309827E759BBD6187413A4A239A9A47C7AE3746F64118F29273208D859AC7C670254EB2D271 EC0" }
With this response a form can be built.
To do this, leave out the url fields, which is the location where the form should be posted.
The other fields are the content fields of the form. These do not have to be shown to the user, of course, but are necessary for a successful payment.
<!DOCTYPE html> <html> <body> <h2>Example form online payment</h2> <form action="https://secure.ogone.com/ncol/test/orderstandard.asp" method="POST"> <label for="fname">PSPID:</label><br> <input type="text" id="PSPID" name="PSPID" value="teqainformatica"><br> <label for="fname">ORDERID:</label><br> <input type="text" id="ORDERID" name="ORDERID" value="20093094"><br> <label for="fname">AMOUNT:</label><br> <input type="text" id="AMOUNT" name="AMOUNT" value="37500"><br> <label for="fname">CURRENCY:</label><br> <input type="text" id="CURRENCY" name="CURRENCY" value="EUR"><br> <label for="fname">PARAMVAR:</label><br> <input type="text" id="PARAMVAR" name="PARAMVAR" value="33388_0"><br> <label for="fname">LANGUAGE:</label><br> <input type="text" id="LANGUAGE" name="LANGUAGE" value="en"><br> <label for="fname">SHASign:</label><br> <input type="text" id="SHASign" name="SHASign" value="21E90410DC5E18E405C7C751E08CD96AB9D3CA68E3C3CCDD21309827E759BBD6187413A4A239A9A47C7AE3746F64118F29273208D8 59AC7C670254EB2D271EC0"><br> <input type="submit" value="Submit"> </form> <p>If you click the "Submit" button, the form-data will be sent to a page called "https://secure.ogone.com/ncol/test/orderstandard.asp".</p> </body> </html>
Try it out
You can now try it out first via, for example, https://www.w3schools.com/html/tryit.asp ?filename=tryhtml_form_submit:
Step 1
Step 2, run:
If the result screen is shown in this way, the connection has been made correctly.
If there are still problems, this will be reported back by the payment provider via a (relevant) error code.
This article is not intended for standard payments. They work "out of the box". This article is only intended for further integration if the booking dialog is already accessible via the API.