Take card payments in a card form with your own look, keep the card for later and show it back to your customers. Truust keeps everything that handles card data in a dedicated PCI module, deployed in a PCI DSS certified environment, so your integration only deals with ids and links.
Overview
Card numbers are the most regulated data in payments. Whoever receives them enters PCI DSS scope, with its audits and controls. That is why Truust isolates card handling in its own component: the PCI card module, a small service deployed in a PCI DSS certified infrastructure, separate from the rest of the platform. It is the only part of Truust that ever sees a card number. Everything else stays as you know it. You create orders and payins with the regular API, Truust decides every step of the payment, and the module only captures the card, talks to the gateway and, when you ask for it, keeps the card safe.The module currently works with Redsys payments (
REDSYS_V2). Other gateways and card issuers will use the same model.How It Fits
- Your backend talks only to the Truust API: orders, payins, cards.
- Truust decides what happens at each step and signs every link to the module. Links are short-lived and cannot be forged or reused across Accounts.
- The PCI card module shows the form, receives the card, sends it to the gateway and, if asked to, stores it encrypted.
- Your customer types the card, and later sees it, inside iframes served by the module.
Enabling It
The module is enabled per Account and per gateway. The Truust team switches the Account’s Redsys gateway to PCI mode; nothing changes in your integration. From then on, everyREDSYS_V2 payin of that Account uses the module’s card form instead of the classic redirect to the bank.
At the same time, the Truust team configures for the Account:
The template changes how the form looks, not where it lives: the form and the card view are always served from a Truust domain, inside an iframe on your page. That is what keeps the card data away from your site.
Contact the Truust team to enable it on your Account.
Taking a Payment
The payment flow is the regular one. Create the order and the payin:direct_link: the checkout page where the customer pays. Open it, or embed it in your own page:
Sizing the iframe
The form tells its parent page how tall it is, so you can avoid scrollbars. Listen for the message and resize your iframe:{ "iframe": { "height": "620px", "width": "100%" } }.
Saving the Card
To keep the card for later, create the payin withsave_card:
The CVC is never stored, as PCI DSS requires. The stored card is deleted automatically when it expires.
Showing the Card
Retrieve the card with the Get card endpoint. If the card was saved through the module and the payment was confirmed, the response includes two extra links:
Both links are signed for your Account: a card can only be read through links generated for the Account that owns it. Ask for them right before you use them, and never store them.
The card view iframe
Embedcard_url where your customer should see the card, for example in their profile:
Card data in JSON
If your company is PCI DSS certified and needs the card itself, for example to pass it to another provider, callcard_json_url from your backend:
403. Request a fresh card from the Get card endpoint whenever you need the data again.
Notes
- Full card numbers stay inside the PCI module. Everywhere else, including the regular Truust API, cards are identified by their
uuidand their last four digits inalias. card_urlandcard_json_urlonly appear when you retrieve a single card, never in card lists.- A card is shown only after its payment is confirmed. Cards from declined payments are never exposed.
- Saving a card through the module needs
save_cardon the payin; payins without it store nothing. - For cards issued by Truust, see Card Issuing.
