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
| Paywall | Hosted Payment Pages | Direct API | |
|---|---|---|---|
| Payment method selection page | Hosted by PayRetailers | Built by you | Built by you |
| Payment method checkout page | Hosted by PayRetailers | Hosted by PayRetailers | Built by you |
| Customer is redirected | Yes | Yes, after selecting a method | No |
| Endpoints used | Create Paywall | Get Payment Methods + Create Transaction | Create Transaction + Get Landing Info |
| Implementation effort | Low | Medium | High |
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.
| Flow | How you get the payment methods | Best for |
|---|---|---|
| Dynamic | Call Get Payment Methods and display the methods it returns. | Merchants in several countries, or who want new methods to appear without code changes. |
| Static | Hard-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
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:
| Field | What to use it for |
|---|---|
name | The name to show to the customer. |
imageUrl | The logo to show next to the name. |
orderPriority | The suggested display order. |
paymentMethodTag | The identifier you send when creating the transaction (step 3). |
Cache the listThe 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 URLA customer reaching your
returnUrldoesn'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.
- Build your selection page with the payment methods you want to offer (see Coverage and Methods).
- The customer selects a method.
- Create the transaction with the tag of that method, as in step 3 above.
- Redirect the customer to the checkout page, as in step 4 above.
- Confirm the result, as in step 5 above.
Keep your list in syncIf 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.
Updated about 6 hours ago