Hosted Page - redirect customers to a Connected Payments payment page
Send customers from your checkout to a secure Connected Payments hosted payment page to enter their payment details.
By the end of this guide, you'll have a working Hosted Page payment running in Sandbox.
Before you start
You'll need:
configId— your configuration IDuserName— your Connected Payments username with transaction permissionssecretKey— your shared secret key used for HMAC generation
Generate signatures on your server. Never expose your secretKey in client-side code.
Your implementation journey
- Generate your payment request
- Build your Hosted payment URL
- Redirect your customer to the payment page
- Handle the payment outcome
- Test the complete journey
Step 1 — Generate your payment request
This step is the same as for an Embedded integration:
- Build the required payment parameters.
- Generate
verifyMessageusing HMAC-SHA256 and yoursecretKey. - Generate it server-side.
See Generate your payment request for the code.
Your server can successfully generate verifyMessage.
Step 2 — Build your Hosted payment URL
Use the Hosted Sandbox endpoint:
const baseUrl =
"https://sandbox.connectedpayments.commbank.com.au/es-client-frontend/hosted";
const paymentUrl = `${baseUrl}?${paramString}&verifyMessage=${verifyMessage}`;
Sandbox and Production each have separate /hosted and /embedded endpoints. See Environments.
Every URL parameter before verifyMessage must be included when generating verifyMessage, in the exact order it appears in the URL - not only the required ones. Optional parameters added after verifyMessage are not signed or verified. See Parameters.
Your server can generate a signed Hosted payment page URL.
Step 3 — Redirect your customer to the Hosted Page
When the customer is ready to pay:
window.location.href = paymentUrl;
The customer leaves your checkout temporarily and completes payment on the Connected Payments hosted payment page.
Selecting Pay takes the customer to the Connected Payments hosted payment experience.
Step 4 — Handle the payment outcome
Payment outcome
The customer completes payment on the Connected Payments Hosted Page, where the payment outcome is displayed.
Notifications (optional)
Notifications can provide server-to-server payment and status updates to your application. See Set up Notifications.
| Mechanism | Purpose |
|---|---|
| Hosted Page response | Customer and browser experience |
| Notification | Server-to-server status information |
If you implement Notifications, treat them as the authoritative payment result.
The customer sees the payment outcome and your application handles it as intended.
Step 5 — Test the Hosted journey
| Scenario | Verify |
|---|---|
| Open checkout | Customer reaches the Connected Payments Hosted Page |
| Successful payment | Payment succeeds and the outcome is shown |
| Declined payment | Decline experience is handled correctly |
| Notifications | Server-side updates work, if implemented |
| Errors | Relevant error scenarios are handled |
See the Testing Guide for Sandbox credentials, test cards and detailed testing scenarios.
Your Hosted Page integration is working
You've now:
- Generated an authenticated payment request
- Built the Hosted payment page URL
- Redirected the customer to Connected Payments
- Handled the relevant payment-status mechanism
- Completed an end-to-end Sandbox test