Object that that was previously initialized with init Kushki method
Object with amount and currency information
options.publicCredentialId
into kushkiInstance
is not valid or the request fails then throw ERRORS.E015import { init } from "@kushki/js-sdk";
import {CommissionConfigurationRequest, requestCommissionConfiguration } from "@kushki/js-sdk/Merchant";
const onRequestCommissionConfiguration = async () => {
try {
const kushkiInstance = await init({
inTest: true,
publicCredentialId: "merchantId"
});
const body: CommissionConfigurationRequest = {
totalAmount: 10,
currency: "USD"
};
const response = await requestCommissionConfiguration(kushkiInstance, body);
// On Success, can get commission config,
// ex. {"commissionMerchantName":"Name","parentMerchantName":"Name","amount":{"currency":"USD","iva":0.45,"subtotalIva":2.5,"subtotalIva0":0},"merchantId":"XXX","totalAmount":2.95}
console.log(response);
} catch (error: any) {
// On Error, catch response, ex. {code:"E015", message: "Error en solicitud de configuración de comisión"}
console.error(error.message);
}
};
Generated using TypeDoc
Function to get the information related to the commission charge configured for a specific merchant