Working with an iframe: Sending an Event to the Merchant’s Website from Cardcom – [For Developers]
When a Cardcom payment page (low-profile page) is opened from the merchant’s website or external system,
using an iframe or popup, the external system can now “capture” an event in which the customer is redirected to a specific URL.
Common events of this type include:
- Redirecting to an external payment page, such as PayPal or BIT.
- Redirecting to a success or failure page, as defined when the page was opened.
To use this mechanism, perform the following steps.
1. Place the payment page’s IFRAME on the purchase page.
2. Send a message to the IFRAME indicating that you are performing the REDIRECT.
3. Capture the REDIRECT message and perform the redirect yourself.
The example file postMessageredirect.htm.txt demonstrates how to use this mechanism and includes these steps.
The event will contain an object with the following information:
- The URL to which the customer was redirected in the context of our payment page (for example, the URL of the external payment site).
- Event identifier — currently fixed as
RedirectingCustOnCardcomPage.