1. Prerequisites
Before you begin, make sure you have met the following prerequisites:- You have an account on the Revolv3 portal with merchant and with one or more configured processors
- You already have a generated developer API key
- You have added the hostname of your website, in which you will embed the checkout page, to the Trusted Checkout Hostnames (Merchant Settings -> Integration Profile).
2. Creating a checkout link
If you have fulfilled all the prerequisites, you can now start creating a link that will be embedded in your website using e.g. iframe.Origin HTTP header
To ensure that requests are sent from an authorized merchant’s API, make sure the HTTP request includes the Origin HTTP header.❗If it is missing, you will get a 400 HTTP error.Api Root
The API Root can be the URL of our Production (https://api.revolv3.com) or Sandbox (https://api-sandbox.revolv3.com) environment.3. Embed the checkout page
Now you have a link to the payment page that you can embed into the your website and wait for the payment to complete. Example of how you can embed a page:4. Added an event handler to your webpage
To let your website (parent window) know when you can close an Iframe, you need to add an event handler to the web page. Since windows cannot interact with each other directly, they need to communicate using messages (postMessage). More information about sending and receiving messages can be found here -> https://developer.mozilla.org/ru/docs/Web/API/Window/postMessage We send this message from our frontend application after the checkout results are uploaded. Handler may look as follows:Check event.origin
Verification that the message came from the revolv3 website (Production or Sandbox) should be mandatory.- Pending (the checkout has been created, the payment has not yet been made),
- PaymentCompleted (A payment attempt was made. The payment result is - Paid),
- PaymentFailed (A payment attempt was made. The payment result is unsuccessful).
Hosted page