Object that that was previously initialized with init Kushki method
options.publicCredentialId
into kushkiInstance
is not valid or the request fails then throw ERRORS.E021import { 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
Function to get the card brand list associated with a specific merchant