Skip to main content

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 ID
  • userName — your Connected Payments username with transaction permissions
  • secretKey — your shared secret key used for HMAC generation
Security

Generate signatures on your server. Never expose your secretKey in client-side code.

Your implementation journey​

  1. Generate your payment request
  2. Build your Hosted payment URL
  3. Redirect your customer to the payment page
  4. Handle the payment outcome
  5. Test the complete journey

Step 1 — Generate your payment request​

This step is the same as for an Embedded integration:

  1. Build the required payment parameters.
  2. Generate verifyMessage using HMAC-SHA256 and your secretKey.
  3. Generate it server-side.

See Generate your payment request for the code.

Checkpoint

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.

Checkpoint

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.

Checkpoint

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.

MechanismPurpose
Hosted Page responseCustomer and browser experience
NotificationServer-to-server status information

If you implement Notifications, treat them as the authoritative payment result.

Checkpoint

The customer sees the payment outcome and your application handles it as intended.

Step 5 — Test the Hosted journey​

ScenarioVerify
Open checkoutCustomer reaches the Connected Payments Hosted Page
Successful paymentPayment succeeds and the outcome is shown
Declined paymentDecline experience is handled correctly
NotificationsServer-side updates work, if implemented
ErrorsRelevant 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