Skip to main content
Version: 1.0.0

Hosted Payment

Hosted Payment is ZenPay's integrated checkout solution. Your frontend initialises the Hosted Payment Page (HPP) with $.zpPayment(...) using values prepared by your backend, then launches the ZenPay-hosted payment experience either in a modal iframe or via full-page redirect.

  • the HPP script is the launcher
  • the hosted payment page is the payment UI
  • your backend is the source of trust

Hosted Payment Page demo

When to use Hosted Payment​

  • Your site or app needs to launch ZenPay checkout
  • You want ZenPay to host the payment UI and handle sensitive data
  • You want modal or redirect flexibility
  • You want your backend to remain responsible for trust and payment state

Other ways to take payments​

  • Use Payment Links when you want a hosted payment link without building an embedded integration.
  • Use the REST API when you need backend-only server-to-server payment operations.

To debug fingerprints, return URLs or validation issues, use the developer tools.

The payment journey (high-level flow)​

  1. Your frontend requests payment bootstrap data from your backend
  2. Your backend generates the fingerprint and prepares the payment payload
  3. Your backend returns safe bootstrap data to the frontend
  4. Your frontend initialises $.zpPayment(...) and launches the HPP
  5. The customer completes payment on the ZenPay-hosted UI
  6. ZenPay redirects the customer back to your site
  7. If you supplied a callbackUrl, ZenPay sends a server-to-server callback to it
  8. Your backend validates the callback before confirming the result

Hosted Payment Journey

Trust model: who's responsible for what​

This split is the reasoning behind the fingerprint, the payload, and the callback validation.

Browser responsibilities. The browser should:

  • Request bootstrap data from your backend
  • Initialise $.zpPayment(...)
  • Launch the payment flow
  • Show pending, success, failed, or cancelled UI states
  • Handle return-page UX

The browser must not:

  • Generate the fingerprint
  • Contain merchant secrets
  • Verify the callback
  • Treat redirect query parameters as the only source of truth

Backend responsibilities. Your backend should:

  • Hold ZenPay credentials securely
  • Generate the fingerprint server-side
  • Create a fresh merchantUniquePaymentId and timestamp per attempt
  • Receive and validate callbacks
  • Update local payment state
  • Return authoritative payment status to the frontend

Playground​

Experiment with HPP options in the Playground without building a full integration first, and see how each option changes the code.