Tokenization is how you securely collect card data in the browser without your server ever touching
raw card numbers. The Strictly platform uses ZeroGateway.js — a
client-side JavaScript library that renders hosted input fields and exchanges card details for a
single-use payment token.
Your server then uses that token to make charge or vault requests. Raw card numbers never pass
through your infrastructure.
The platform uses two separate keys: a tokenization key (client-side, loaded with ZeroGateway.js)
and an API key (key-hash, server-side only). They are not interchangeable — using the wrong
one in the wrong context will fail silently or with an auth error.
How it works
Code
Browser Your Server Strictly API │ │ │ │ 1. Load ZeroGateway.js │ │ │ (tokenization key) │ │ │ │ │ │ 2. Customer enters card details │ │ │ in hosted input fields │ │ │ │ │ │ 3. ZeroGateway.js sends card data ──────────────────────► │ │ directly to Strictly │ │ │ │ │ │ 4. Strictly returns paymentToken│ │ │◄──────────────────────────────── │ │ │ │ │ │ 5. Send paymentToken to ───────►│ │ │ your server │ │ │ │ 6. POST /payment/charge │ │ │ { paymentToken } ───►│ │ │ │
Setup
Get your tokenization key
In the Strictly dashboard, go to Merchant Settings → Security Keys and copy the value
under Tokenization Source. This key is safe to expose in client-side code.
Create placeholder containers
ZeroGateway.js injects hosted iframes into your page. Add empty div elements where you
want the fields to appear:
Pass the token from the callback to your backend. Your server then uses it to make the
charge request:
payment.js — send to your backend
async function sendTokenToServer(paymentToken) { const response = await fetch("/api/charge", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ paymentToken }), }); const result = await response.json(); if (result.success) { // Show confirmation } else { // Show error to customer }}
Charge from your server
Your server receives the token and makes the charge request to the Strictly API. The raw
token never hits the browser again. The example below uses Java, but this works the same in any server-side language:
A paymentToken is valid for one transaction only. Once used in a charge, vault, or customer
create request, it is invalidated. Do not store or reuse tokens.
If you need to charge a customer multiple times without re-collecting their card, use the
Customer Vault to store their card and charge via vaultId.
Styling the hosted fields
ZeroGateway.js fields are iframes — you cannot style them directly with your page's CSS. Instead, pass
style rules through the CollectJS.configure options: