Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Whether inside event data, or as an argument passed to a supplied callback, the data structure will always arrive in this format:

{
    type: 'validation', 'tokenization' | 'cardType'
    fieldName: 'cardNumber' | 'cardCvv' | 'cardExpiry',
    success: boolean,
    message: string,
    paymentToken: string
}

type

'validation' | 'tokenization' | 'cardType'

the type of message

fieldName

'cardNumber' | 'cardCvv' | 'cardExpiry'

 

success

boolean

result of an action. Eg validation or tokenization

message

string

Optional. Eg for validation, might include a validation error string.

paymentToken

string

The same paymentToken to be used in the sale API.

cardTypeData

CardTypeData

Only applies if the type is `cardType`

CardTypeData

This is only useful for receiving the detected card type from the user:

typeData?: {
    niceType: string;      // Human-readable card type (e.g., "Visa")
    type: string;          // Card type code
    patterns: number[] | [number[]];  // Valid number patterns
    gaps: number[];        // Positions of gaps in card number
    lengths: number[];     // Valid card number lengths
    code: {
        size: number;      // CVV length
        name: string;      // CVV field name (e.g., "CVV")
    };
    matchStrength?: number; // Confidence of card type match
};

 

  • No labels