Hosted Payment Pages

With Hosted Payment Pages, you build your own payment method selection page and PayRetailers hosts the checkout page of the method your customer picks. You keep full control of the look and order of the payment options, while PayRetailers handles the payment instructions (QR code, bank details, voucher, etc.) for each method.

How it compares

PaywallHosted Payment PagesDirect API
Payment method selection pageHosted by PayRetailersBuilt by youBuilt by you
Payment method checkout pageHosted by PayRetailersHosted by PayRetailersBuilt by you
Customer is redirectedYesYes, after selecting a methodNo
Endpoints usedCreate PaywallGet Payment Methods + Create TransactionCreate Transaction + Get Landing Info
Implementation effortLowMediumHigh

Choose Hosted Payment Pages when you want the payment options to look native to your checkout, but don't want to build and maintain the payment instructions page for every method and country.

Before you start

  • You have your Shop ID, Secret Key and subscription key. See Authentication.
  • Your server IP addresses are whitelisted by PayRetailers.
  • You have a public HTTPS endpoint to receive Notifications (notificationUrl).
  • You have a page to bring the customer back to after paying (returnUrl).

Choose your flow

There are two ways to build the selection page. Both end the same way: you create the transaction and redirect the customer to the PayRetailers checkout page.

FlowHow you get the payment methodsBest for
DynamicCall Get Payment Methods and display the methods it returns.Merchants in several countries, or who want new methods to appear without code changes.
StaticHard-code the payment methods you want to offer on your selection page.A short, stable list of methods in one or two countries.

Dynamic flow

Dynamic flow: get payment methods, display them, create the transaction with the selected method and redirect the customer to the checkout URL.

Dynamic flow

1. Get the available payment methods

Call Get Payment Methods filtered by the customer's country and, optionally, by currency and channel (online, cash, credit card or wallet). The response lists the methods active for your shop. For each one you receive:

FieldWhat to use it for
nameThe name to show to the customer.
imageUrlThe logo to show next to the name.
orderPriorityThe suggested display order.
paymentMethodTagThe identifier you send when creating the transaction (step 3).
📘

Cache the list

The list of payment methods rarely changes. Cache it per country and currency and refresh it periodically, instead of requesting it on every checkout.

2. Display the methods on your checkout

Show each method with its name and logo, in the suggested order, using your own design. The customer selects the method they want to pay with.

3. Create the transaction with the selected method

From your server, call Create Transaction with the tag of the selected method, the amount and currency, the customer's details and your notificationUrl and returnUrl. Required customer details vary by country and method; see Create Transaction and Transaction Parameters.

The transaction is created with status PENDING. Keep its uid: it identifies the transaction in Get Transaction by UID and in your notifications.

4. Redirect the customer to the checkout page

The response includes the URL of the PayRetailers checkout page for the selected method (form.action). Redirect the customer there. The page shows the payment instructions in the language you requested.

5. Confirm the result

The customer completes the payment and is sent back to your returnUrl. The transaction then follows the standard transaction flow, and PayRetailers sends notifications to your notificationUrl.

🚧

Don't rely on the return URL

A customer reaching your returnUrl doesn't mean the payment was approved. Many methods (cash, bank transfer) are paid hours or days later. Always confirm the final status from the notification or with Get Transaction by UID before releasing goods or crediting balance.

Static flow

The static flow is the dynamic flow without step 1.

  1. Build your selection page with the payment methods you want to offer (see Coverage and Methods).
  2. The customer selects a method.
  3. Create the transaction with the tag of that method, as in step 3 above.
  4. Redirect the customer to the checkout page, as in step 4 above.
  5. Confirm the result, as in step 5 above.
🚧

Keep your list in sync

If a method is disabled for your shop, the transaction is rejected. Check with your account manager before adding or removing methods, or switch to the dynamic flow.




Did this page help you?