Geopagos PCI Component
The Geopagos PCI Component captures card data on your checkout in compliance with PCI-DSS, delegating the handling of sensitive data (PAN, CVV, expiration) to an isolated environment provided by Geopagos. Each sensitive field lives in its own cross-origin iframe and encrypts its value there: the card number never touches the DOM of your page.
The component does not create the payment session and does not execute the charge. Your backend does both. The amount and merchant are fixed when the session is created, so they cannot be tampered with from the browser. The card token never comes back to the page.
Environments
Replace {cdn_host} and {api_host} in the examples with the host for your environment.
| Environment | CDN ({cdn_host}) | API ({api_host}) |
|---|---|---|
| Staging | pci-card-form.stg.geopagos.io | api.stg.geopagos.io |
| Production | Provided by Geopagos | Provided by Geopagos |
API calls use the base path https://{api_host}/api/v1.0. Load the component from
https://{cdn_host}/v1/main.js.
Sequence diagram
Mount the component
<div id="card-form-container"></div>
<script type="module">
const { Checkout, CheckoutError } = await import('https://{cdn_host}/v1/main.js');
// `sessionId` came from YOUR BACKEND via POST /api/v1.0/sessions.
const form = new Checkout(sessionId, {
onSubmit: async () => {
// The session is ready to be charged — your backend runs the charge.
await fetch('/checkout/charge', { method: 'POST' });
},
onError: (error) => console.error(error.code, error.message),
});
await form.render('card-form-container');
</script>
Sandbox Demo
The sandbox below runs the staging build of the component
(pci-card-form.stg.geopagos.io). Because a static page cannot sign a Bearer JWT, it asks
you to paste a session_id instead of creating one — that is the only difference with a real
integration. Create one against staging (see the table above) and paste it in, or open this
page with ?session=<id> to mount on load.
curl -X POST 'https://api.stg.geopagos.io/api/v1.0/sessions' \
-H 'Authorization: Bearer <access token from the Geopagos identity provider>' \
-H 'Content-Type: application/json' \
-d '{"amount": 55555.00}'
This example uses merchant credentials. With tenant credentials, also send the
merchant_id you are charging for. See
Backend Integration.
Sessions expire in 15 minutes and are single-use: once charged or expired, mount again with a
new one. Test cards: Visa 4111 1111 1111 1111, Mastercard 5555 5555 5555 4444,
Amex 3782 822463 10005.
More information
- Quick start — mount snippet (Hybrid + new card)
- Embedding the component — loading, mounting, browsers
- Backend Integration — create session and charge
- Saved cards and modes — modes
0|1|2, vault APIs, CVV retry