Function requestSecureInit

  • Introduction

    Function to request a secure initialization of Cardinal 3DS or Sandbox 3DS depending on the merchant settings..

    Parameters

    • kushkiInstance: IKushki

      The Kushki instance that was previously initialized.

    • secureInitRequest: SecureInitRequest

      You must define this object in order to request the initialization of 3DS.

    Returns Promise<SecureInitResponse>

    • Returns a Promise that resolves to either a SecureInitResponse or an ErrorResponse.

    Throws

    • if the param: secureInitRequest does not have the needed card length (cardNumber < 6 or cardNumber > 19) ERRORS.E018
    • if the request fails to obtain the jwt ERRORS.E004

    Example

    const kushkiInstance = await init({
    inTest: true,
    publicCredentialId: "public-merchant-id"
    });

    const secureInitRequest:SecureInitRequest = {
    card:{
    number: "card-number"
    }
    };
    try {
    const response = await requestSecureInit(kushkiInstance, request);
    console.log(response);
    } catch(error) {
    console.log(error);
    }

Generated using TypeDoc