Skip to content
EN
Book a demo

HomeGuides

How to Create a Secure Payment Page on Top of One API

Knowing how to create a secure payment page starts with a definition: it's a page where the card is typed into a field your payment provider controls, the page loads over HTTPS, and your server decides the amount. You build the page once, in front of a single API, and the payment methods behind it can change without touching the page.

On this page

This guide gives the order of work for a business or platform that wants to know how to create a payment page without a rebuild per provider. It ends with the checks to run before real traffic and the failures that tend to appear in the first week.

01Before you start

A payment page touches design, security and finance, so the inputs come from different people. Collect them before you pick a design, because the answers limit your options.

What you need Who owns it Where it comes from
The channels you sell through (web, app, email links) Product owner Your roadmap
The payment methods and countries you must cover at launch Payments lead Your sales plan and your provider list
Sandbox credentials and API documentation Backend engineer Your payment platform
A domain and a TLS certificate for the page Infrastructure engineer Your DNS and hosting setup
The brand kit: logo, colors, button text, supported languages Designer Your brand team
Your acquirer's view on PCI validation Compliance lead Your acquirer

If the platform asks for credentials per environment, keep sandbox and production keys in separate secret stores from day one.

02How to create a secure payment page: step by step

The sequence below goes from a decision to a tested page. Each step names what to set and what you should see afterwards.

  1. 01 Choose where the card is typed

    You have three realistic options. A hosted page is served by the platform on your own domain, and the customer types the card there. Embedded fields come from the platform's script and sit inside your page. A fully custom form posts card details from your page, which makes your page a secure-form project in its own right.

    For most teams the first two are the right starting point, because the platform controls the card fields and not your own code. Write the decision in one sentence per channel, for example "web: hosted page, app: SDK fields". The PCI scope page shows how each option changes your validation.

  2. 02 List the methods and markets

    Write the payment methods you need by country: cards, wallets, bank transfers, local methods. Mark which are required at launch and which come later.

    A good page treats this list as data, not as design. The page asks the platform which methods fit this customer, instead of carrying a hard-coded button per provider. After this step you can say what the page must show for a customer in each market.

  3. 03 Brand the page

    Set the logo, colors, button labels and languages. Put the page on a domain you own, such as a subdomain of your site, so the customer sees your name in the address bar. That's how a white-label checkout stays white-label end to end.

    Open the result on a phone first. Many customers pay on a phone, and a field that is hard to tap or a button below the keyboard costs payments. You should see the same look on the page, the confirmation and the emailed receipt.

  4. 04 Create the payment from your server

    Your server, never the browser, decides the amount, the currency and your own order reference. It sends them to the platform's API and gets back what the page needs, such as an address to send the customer to or a token for the embedded fields.

    Read the API documentation for the exact request and response. Look for how to pass your order reference, where to set the return addresses and how long the session stays valid. Don't copy values from a tutorial. The names belong to your provider's documentation.

  5. 05 Connect the result to your order system

    Treat the customer's return to your site as a hint, not a confirmation. The customer can close the tab, lose signal or edit the address. Confirm the status through a webhook sent to your back end, or by reading the payment from your server, and mark the order paid only then.

    Make the webhook handler safe to run twice. Providers resend events when they get no answer, so a second delivery must not ship a second parcel. After this step an order has one clear status in your system, whichever way the customer left the page.

  6. 06 Lock down the page

    Serve everything over HTTPS and keep the list of scripts on the page short. Every script on a payment page can read what the customer types if it's allowed to, so list each one, give it an owner and block the rest with a content security policy.

    PCI DSS v4.0.1 asks for this inventory and for detection of changes to scripts on payment pages. The standard and its questionnaires are on the PCI SSC site. Test the policy in report-only mode first, since a policy that's too strict will block the provider's own script.

  7. 07 Add a method or provider without touching the page

    When the business adds a method, the change should happen behind the page, in the platform's settings. Run this as an exercise before launch: turn on one extra method in the sandbox and confirm the page shows it with no deployment on your side.

    If that needs a code change, the page is carrying logic that belongs in the layer. Move it before you scale.

03Testing before real traffic

Run the checks in the sandbox of the platform, with test cards and test methods, and repeat them on a staging copy of the live domain.

  • Complete a payment on a phone and a laptop, in two languages.
  • Pay with a card that the sandbox declines and confirm the customer sees a clear message and can try another method.
  • Close the tab right after paying and check that the order still becomes paid through the webhook.
  • Replay the same webhook twice and confirm one order, one shipment.
  • Load the page with the network tab open and match every script to your inventory.
  • Change the amount in the browser and confirm the server rejects it.
  • Open the receipt email and check the brand, the amount and the currency.

Keep the results with the release notes. They are your evidence if an assessor or a partner asks how the page was tested.

04Rolling back, and what goes wrong

Customers pay but orders stay open when the webhook never arrives. Check that the endpoint is public, answers quickly and sits behind no login. Until it works, reconcile by reading payments from the API, and keep the page live only if that job runs.

The page loads with no card fields when your content security policy blocks the provider's script. Roll the policy back to report-only, read the blocked hosts from the console, and add only the ones the provider documents.

A wrong amount reaches the platform when the browser sets it. Move the calculation to your server, drop the old release and refund anything that was charged at the wrong value. Never patch it in the front end.

Finally, a new method shows up on staging and not on production, because the two environments have different settings. Compare the two configurations line by line before blaming the page. If the live page misbehaves after a release, point the channel back to the previous version and keep the new one on staging.

05Where the platform does the step

The platform serves the page for you. It runs on your domain, carries your brand from the URL to the buttons, and picks the methods to show from the customer's location, language and behavior. A JS SDK gives you embedded inputs when you want the fields inside your own page.

One integration covers every connected provider, with no separate SDK per provider, and tokenized cards are updated for recurring payments. Status updates arrive by webhook. The checkout integration page compares the page with host-to-host, mobile SDKs and plugins.

06FAQ

How do I make a payment page that meets PCI DSS?

Keep card entry on a field your provider controls, either a hosted page or embedded fields. Add HTTPS, a script inventory and a content security policy. Your acquirer confirms the questionnaire that applies to your setup.

Can I build a white-label checkout for my merchants?

Yes, if the platform lets you brand the page URL, logo, buttons and reports. Check that the brand carries into the confirmation and receipt too. Ask how each merchant's settings, methods and languages are managed.

How do I add a checkout to an existing payment system?

To integrate a checkout solution with an existing payment system, keep your order system and add the page in front of the platform's API. Your server creates the payment, the page collects the card, and a webhook returns the result to the order system you already run.

Do I need a different page for each provider?

No. A page in front of one API asks the platform which methods to show. Adding a provider or a method becomes a setting, so the page stays the same as long as the API call stays the same.

Next step

Get the page live without a rebuild per provider

Tell us your channels and countries, and we'll show how the page, the methods and the webhooks fit your current setup. Contact the team.

Book a demo

Map your integrations onto one API

We look at the providers you run today and what moving them behind one API would take.