Function requestBrandsByMerchant

  • Function to get the card brand list associated with a specific merchant

    Parameters

    • kushkiInstance: IKushki

      Object that that was previously initialized with init Kushki method

    Returns Promise<BrandByMerchantResponse[]>

    • List with all brands associated with the merchant

    Throws

    • if options.publicCredentialId into kushkiInstance is not valid or the request fails then throw ERRORS.E021

    Example

    Basic request Brands by merchant
    import { init } from "@kushki/js-sdk";
    import {BrandByMerchantResponse, requestBrandsByMerchant } from "@kushki/js-sdk/Card";

    const onRequestBrandByMerchant = async () => {
    try {
    const kushkiInstance = await init({
    inTest: true,
    publicCredentialId: "merchantId"
    });

    const response = await requestBrandsByMerchant(kushkiInstance);

    // On Success, can get brand list,
    // ex. [{"brand":"visa","url":"https://.../visa.svg"},{"brand":"masterCard","url":"https://.../masterCard.svg"}]
    console.log(response);
    } catch (error: any) {
    // On Error, catch response, ex. {code:"E021", message: "Error en solicitud de marcas de tarjetas del comercio"}
    console.error(error.message);
    }
    };

Generated using TypeDoc