Sessions
A session is a backend-only alternative to the Hosted Payment Page. Your backend calls the Merchant API to get a checkout URL, and you show that page to the customer yourself.
The page is the same hosted payment page that Hosted Payment uses. The only difference is who shows it. With the HPP, ZenPay shows the page in a modal on your page. With a session, you show it.
High-level flow
- Your backend calls
POST /v2/sessionswith your Merchant API credentials (see Authentication). Send your payment page's base address asendpointUrl. Don't send a fingerprint or anapiKeyin the body. - The response returns
endpointUrl, the full checkout address, along withsecureTokenandexpiresAt. - Show that page before
expiresAt: in your own modal, embedded in your page, or by sending the customer to the URL.
See Create a session for every field.
When to use sessions
Use a session when you want to show the hosted payment page yourself instead of loading the HPP.
Confirm the payment
The customer coming back to your redirectUrl is not proof of payment. See Handling the customer's return.