Skip to main content
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.
Card numbers and CVCs travel only between the customer’s browser, the module and the gateway. They stay inside the PCI module: they never reach your servers, nor the rest of the Truust platform, its API or its logs.

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, every REDSYS_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:
The payin comes back with a direct_link: the checkout page where the customer pays. Open it, or embed it in your own page:
Inside, the customer sees the module’s card form. On submit, the module sends the card to Redsys and, if the bank asks for it, runs the 3-D Secure challenge in the same iframe. When it is done, the customer is sent to your success or failure URL, and you receive the usual payin webhooks.

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:
The message has the shape { "iframe": { "height": "620px", "width": "100%" } }.

Saving the Card

To keep the card for later, create the payin with save_card:
The payin is linked to a card record of the customer. When the payment goes through, the card is saved twice, each copy for a different purpose: 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

Embed card_url where your customer should see the card, for example in their profile:
The card is shown inside the module’s page, so the number goes straight from the PCI environment to your customer’s screen. Your page only holds the iframe, in the same way Stripe Issuing shows its cards with secure elements. As with the card form, only your allowed domains can embed it.

Card data in JSON

If your company is PCI DSS certified and needs the card itself, for example to pass it to another provider, call card_json_url from your backend:
The link works once: a second call returns 403. Request a fresh card from the Get card endpoint whenever you need the data again.
Receiving the card number puts your systems in PCI DSS scope. Only use card_json_url if your company is PCI DSS certified, and never log, store or forward the response outside that scope.

Notes

  • Full card numbers stay inside the PCI module. Everywhere else, including the regular Truust API, cards are identified by their uuid and their last four digits in alias.
  • card_url and card_json_url only 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_card on the payin; payins without it store nothing.
  • For cards issued by Truust, see Card Issuing.