Skip to main content
The SDK is published as @d24/sdk / @d24/sdk-minimal and exposes window.D24. This is expected: use it as shown with your Pandablue credentials.

Installation

NPM
HTML Script Tag
Ensure to install the latest version in this link!

Constructor

Initializes the SDK. This must be called before any other methods. new SDK(publicKey, options) Parameters
ParameterTypeDescriptionRequiredPossible Values
publicKeystringYour public API key provided by Pandablue.Yes
optionsobjectConfiguration options for the SDK.Yes
options.environmentstringThe environment to use.Yes’stg’, ‘production’

Usage

Errors

Methods

generateToken({ card }) Validates credit card details and exchanges them for a secure, single-use token. This is an asynchronous method. Returns: Promise<{token: string}> - A promise that resolves to an object containing the token.

Parameters

ParameterTypeDescriptionRequired
cardobjectAn object containing the credit card details.Yes
card.numberstringThe full credit card number.Yes
card.holderstringThe full name of the cardholder.Yes
card.cvvstringThe 3-digit (or 4-digit for Amex) security code.Yes
card.expirationMonthstringThe 2-digit expiration month (e.g., “09”).Yes
card.expirationYearstringThe 2-digit expiration year (e.g., “25”).Yes

Usage

Errors