Bolt’s tokenizer is a public package on NPM and can be used to implement custom back-office integrations, such as direct payment processing, when also paired with the authorization endpoint.
Tokenization is handled in a separate service from Bolt Checkout and is PCI compliant. See the Authorization endpoint’s request body schema for more information.
import TkClient from @boltpay/tokenizer;
TkClient
object:const tkClient = new TkCLient(env, async (url, request) => fetchFunc(url, request));
In the initial call, the env
value can be to either sandbox
or production
. fetchFunc
is a function used to send HTTP requests (for example, you could use the javascript built-in function fetch).
postToken
method with the credit card information:const cardToken = tkClient.postToken(credit_card);
v1/merchant/transactions/authorize
endpoint found here.credit_card
is the javascript object {cc: credit card number, cvv: cvv}
postToken
returns the javascript object {token, expiry, last4, bin, network}
import TkClient from @boltpay/tokenizer;
const tkClient = new TkCLient("sandbox", async (url, request) => fetch(url, request));
const cardToken = tkClient.postToken({cc: "4111111111111111", cvv: "000"});