How you lead customers into Dintero Checkout matters as much as the checkout itself. This page lists the most common integration mistakes, starting with the ones that cause failed purchases or orders that do not match what the customer paid for.
Validate the order before and after payment
The customer can change the order while the checkout is open: on the same page, or in another browser tab. They can also pay before they have filled in fields on your own page that you need to accept the order (for example delivery date, terms or pickup store). Both cases lead to failed purchases, or to paid orders you cannot fulfil.
- Collect required input before you show the checkout, or add it to the session before you embed the checkout. Don’t show required order fields next to the embedded checkout.
- When the cart changes, lock the session with
checkout.lockSession() in the Checkout Web SDK, update it with PUT /sessions/{session_id}, then call checkout.refreshSession(). See Updating a checkout session.
- Use the
onValidateSession handler in the Checkout Web SDK to stop payment when the session no longer matches the cart, or your form is incomplete. The checkout pauses payment until you return success: true. Return success: false with a clientValidationError message to block it.
- Before you accept the order, check on your server that the amount and items in the transaction match the order you will deliver.
Don’t rely on return_url alone
The customer may never reach your return_url, for example if they close the browser or lose connection right after paying. If you only mark orders as paid on the return_url, a paid order can look like a failed one.
- Implement
callback_url. It is called server to server, and Dintero retries failed deliveries (for example when your server returns a 5xx status).
- Verify the transaction before you mark the order as paid.
- Handle
return_url and callback_url arriving in any order, or at the same time.
See After payment.
Secure your site with a Content Security Policy
A Content Security Policy (CSP) tells the browser which scripts, frames and images your checkout page may load. It limits the damage if someone manages to inject a script into your page. See the MDN guide to Content Security Policy for all directives and how they work.
The embedded checkout runs in an iframe on https://checkout.dintero.com. Everything inside the iframe, including card forms, 3-D Secure and payment method redirects, is covered by Dintero’s own security headers. Your policy only needs to allow what runs on your page:
Avoid unsafe-inline for scripts
script-src 'unsafe-inline' lets every inline script on the page run, including one an attacker injects. That removes most of the protection a CSP gives you. Use one of these instead:
- Nonces. Generate a new random value for every response. Add it to the header (
script-src 'nonce-r4nd0m') and to each script tag you trust (<script nonce="r4nd0m">). Scripts without the right nonce are blocked. This covers inline scripts such as a dintero.embed(...) snippet.
strict-dynamic. Add 'strict-dynamic' next to the nonce. Scripts you trust with a nonce can then load other scripts (for example code-split bundles or a tag manager), without listing every host. Browsers that support it ignore host allowlists in script-src.
- Move inline code to files. If you have no inline scripts,
script-src 'self' is enough.
Example policy
Roll out with the Content-Security-Policy-Report-Only header first. The browser reports what it would block without blocking it, so you can fix your policy before you enforce it.
If your policy cannot allow frames, use the redirect checkout instead of the embedded checkout. See Embedded vs redirect checkout.
Use Subresource Integrity for scripts from a CDN
If you load scripts from a public CDN, anyone who compromises the CDN can change the code that runs on your checkout page. Subresource Integrity (SRI) stops this. You add a hash of the expected file to the script tag, and the browser refuses to run the file if it does not match.
- Always add an
integrity attribute and crossorigin="anonymous" to every script and stylesheet you load from a CDN, including the Checkout Web SDK.
- Pin an exact version in the URL. A hash only works for a file that never changes, so don’t use URLs that point to “latest”.
- When you update a script, update its hash at the same time.
Each Checkout Web SDK release includes a ready-made snippet with the version-pinned CDN URL and its hash:
Copy the snippet for the version you use from the release notes. Don’t reuse the hash above for a different version.
Follow PCI DSS rules for the page that embeds the checkout
When you embed Dintero Checkout, card data is entered in the Dintero iframe and never reaches your systems. This makes you eligible for the simplest self-assessment questionnaire, SAQ A. The page that hosts the iframe is still in scope, because a malicious script on that page could hide the iframe and show a fake card form instead.
- Never collect card data yourself. Don’t add your own card number fields, and don’t place anything on top of or inside the Dintero iframe. Collecting card data on your own page takes you out of SAQ A.
- Load the iframe directly from Dintero. Don’t proxy, copy or modify the checkout page. Serve your whole site over HTTPS.
- Protect the page against script attacks. SAQ A requires you to confirm that your site is not susceptible to attacks from scripts that could affect your e-commerce system. Keep an inventory of the scripts on the page that embeds the checkout, and remove the ones you don’t need, such as third-party tags on the payment step. A strict Content Security Policy and Subresource Integrity help you meet this.
- Complete SAQ A every year. Send it to merchant-pci@dintero.com.
See PCI DSS compliance for merchants for your full responsibilities.
Let the customer choose a payment method once
A common mistake is showing separate payment method buttons on your site (for example Vipps and Card) that all open the full checkout. The customer then has to choose the payment method again inside Dintero Checkout.
Show one Pay button that opens Dintero Checkout, and let the customer choose there. If you want your own payment method buttons, pass show_payment_type so the checkout only shows the method the customer already chose. See Limit checkout to a single payment type.
Don’t ask for the same data twice
If the customer already gave you their email, phone number or address, prefill it when you create the session, for example customer.email, customer.phone_number and order.shipping_address. See Create a session.
Match the checkout language
Set the checkout language to match your site. Use the language option in the Checkout Web SDK (an ISO 639-1 two-letter code, for example no or en), or the language query parameter on the checkout URL.
Handle cancelled payments
When the return_url has error=cancelled, send the customer back to their cart with the items still in it, so they can try again. Don’t show a dead-end error page or empty the cart. See After payment.
Use embedded or redirect, not pop-out
The pop-out checkout is a legacy option, and browser pop-up blockers can stop it from opening. Use the embedded or redirect checkout. See Embedded vs redirect checkout.
Keep the SDK and plugins up to date
Updates ensure your integration has the latest security fixes and supports new checkout features.
- Follow the releases of
@dintero/checkout-web-sdk and update regularly.
- Keep your e-commerce plugin up to date. If you fork a plugin, keep pulling changes from upstream.
Use current, correct payment logos
Outdated, self-made or stretched logos make your checkout look untrustworthy.
- Use logos from the Branding API. Payment schemes update their logos from time to time, and the Branding API keeps them current.
- Use the payment profile logo URL, so the logos match the payment methods enabled in your checkout.
- Keep the aspect ratio. Set the size with the
width path parameter, and set only the width (or height: auto) in your CSS.
Last modified on December 1, 2026