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
NPMEnsure 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
| Parameter | Type | Description | Required | Possible Values |
|---|---|---|---|---|
publicKey | string | Your public API key provided by Pandablue. | Yes | |
options | object | Configuration options for the SDK. | Yes | |
options.environment | string | The 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
| Parameter | Type | Description | Required |
|---|---|---|---|
card | object | An object containing the credit card details. | Yes |
card.number | string | The full credit card number. | Yes |
card.holder | string | The full name of the cardholder. | Yes |
card.cvv | string | The 3-digit (or 4-digit for Amex) security code. | Yes |
card.expirationMonth | string | The 2-digit expiration month (e.g., “09”). | Yes |
card.expirationYear | string | The 2-digit expiration year (e.g., “25”). | Yes |