Skip to main content
This document provides a detailed technical reference for all components, methods, and properties available in the Credit Card SDK.
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.

SDK Constructor

The SDK is instantiated using a constructor that takes a public key and an options object.

Parameters

ParameterTypeDescriptionRequiredPossible values
publicKeystringYour unique public key provided by Pandablue.true
optionsobject[]An object containing configuration options.true
options.environmentstringSpecifies the operating environment.truestg, prod
options.localestringSets the language for the UI components.trueen, es, pt

Instantiation Errors

Attempting to instantiate or use the SDK incorrectly will result in one of the following errors:

<CreditCardForm /> Component

This is the primary UI component for collecting and processing credit card information.

Properties

PropertyTypeDescriptionRequired
authTokenstringThe unique checkout_token returned by your call to the Deposit Creation Endpoint.true
countrystringThe two-letter ISO 3166-1 alpha-2 country code.true
onSuccessfunctionCallback function executed when the payment is successful.true
onErrorfunctionCallback function executed when an error occurs during the payment.true
onBackfunctionCallback function executed when the user clicks the “Go Back” button.true
onTokenGenerationErrorfunctionCallback function executed when an internal error occurs while generating the payment token.true
messagesobject[]An object for defining custom text on the payment completion screens.false

messages Object Structure

You can override the default text for the success and error screens by providing a messages object.
PropertyTypeDescription
messages.paymentComplete.success.titlestringThe title displayed on the success screen.
messages.paymentComplete.success.descriptionstringThe description text displayed on the success screen.
messages.paymentComplete.error.titlestringThe title displayed on the error screen.
messages.paymentComplete.error.descriptionstringThe description text displayed on the error screen.

Callbacks

onTokenGenerationError This callback function will be executed when an error occurs generating token.
onBack This callback function will be executed when the user clicks on the Go Back button.