Force redirect
Overview
By default, Smart Checkout shows the customer a page where they review the order and choose a payment method. For some alternative payment methods this extra step is unnecessary, especially when only one payment method is available to the customer.
With the forceRedirect parameter, you can ask Smart Checkout to automatically redirect the customer to the selected payment method as soon as Smart Checkout loads. The customer lands directly on the payment method’s login or authorization page, which shortens the payment journey.
Please note: Auto-redirection is only available for the payment methods listed in Supported payment methods.
When does the redirect happen?
The customer is automatically redirected when both of the following are true:
- The Smart Checkout URL contains the parameter
forceRedirect=true. - The payment method is the only payment method available in Smart Checkout for that payment source.
If either condition is not met, Smart Checkout loads normally and the customer chooses a payment method as usual.
Supported payment methods
The table below lists every payment method that supports forceRedirect. We add methods to this list as support is rolled out.
| Payment method | MethodId | Where the customer is redirected |
|---|---|---|
| Viva Wallet | 8 |
Viva Wallet login page |
| MobilePay | 36 |
MobilePay authorization page |
| IRIS | 29 |
Customer’s bank, to authorize the IRIS payment |
The
MethodIdvalues are the same ones used by Pre-selected Payment Method.
How to use it
Add forceRedirect=true to the Smart Checkout redirect URL.
| Environment | URL format |
|---|---|
| Production | https://www.vivapayments.com/web/checkout?ref={OrderCode}&forceRedirect=true |
| Demo | https://demo.vivapayments.com/web/checkout?ref={OrderCode}&forceRedirect=true |
Where:
| Parameter | Type | Description |
|---|---|---|
ref |
string | The OrderCode of the payment order you created. Required. |
forceRedirect |
boolean | Set to true to enable auto-redirection. Any other value, or omitting the parameter, keeps the default behavior. |
Example
https://www.vivapayments.com/web/checkout?ref=1234567890123456&forceRedirect=trueCombining with other parameters
forceRedirect can be used together with the other Smart Checkout URL parameters, such as color:
https://www.vivapayments.com/web/checkout?ref={OrderCode}&color={ColorCode}&forceRedirect=truePayment method details
Viva Wallet
When Viva Wallet is the only payment method in Smart Checkout and the URL contains forceRedirect=true, the customer is automatically redirected to the Viva Wallet login page.
Cancelling the payment
If the customer presses Cancel on the Viva Wallet page, the payment order is cancelled and the customer is returned to your Failure URL.
Precondition: The Cancel button must be enabled for your payment source. In the Viva Wallet banking app, go to Sales → Online Payments → Websites/Apps → select your source → enable the Cancel button.
Browser back button
Because the customer is redirected away from Smart Checkout immediately, the browser Back button does not behave consistently across browsers and devices. In some, going back cancels the order. In others, the customer simply returns to the previous page and the order stays open.
Do not rely on the Back button to cancel an order. Always confirm the final state of the payment order through a webhook or the Retrieve Transaction API call, as described in the Smart Checkout integration guide.
The table below shows what happens in each browser and device.
| Browser / device | Browser Back button cancels the order | Viva Wallet Cancel button cancels the order |
|---|---|---|
| Chrome (desktop) | ❌ | ✅ |
| Firefox (desktop) | ✅ | ✅ |
| Edge (desktop) | ❌ | ✅ |
| Opera (desktop) | ❌ | ✅ |
| Safari (iOS) | ✅ | ✅ |
| Edge (iOS) | ✅ | ✅ |
| Chrome (iOS) | ✅ | ✅ |
| Edge (Android) | ❌ | ✅ |
| Chrome (Android) | ❌ | ✅ |
✅ The order is cancelled. ❌ The order is not cancelled.
MobilePay
When MobilePay is the only payment method in Smart Checkout and the URL contains forceRedirect=true, the customer is automatically redirected to the MobilePay authorization page.
IRIS
When IRIS is the only payment method in Smart Checkout and the URL contains forceRedirect=true, the customer is automatically redirected to their bank to authorize the IRIS payment.
Best practices
- Only use
forceRedirect=truewhen the payment method is the only one offered. This is when it gives the customer a faster journey. - Always verify the payment status on your server. Use the
Transaction Payment Createdwebhook or the Retrieve Transaction API call. Never assume the outcome from the customer’s browser navigation. - Handle customers returning without paying. Because browser behavior varies, a customer may come back to your site without completing the payment. Make sure your Failure URL page lets them retry or choose another way to pay.
Get Support
If you would like to integrate with Viva, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!