| Characteristic | Kushki.js | Kushki.js Hosted Fields | Details |
|---|---|---|---|
| Size | ~2.7 MB | ~307* KB | |
| Modularity | NO | YES | |
| Import via CDN | YES | YES | |
| Import via NPM | YES | YES | |
| Import via YARN | NO | YES | |
| Library Settings | Kushki() object instance | KushkiOptions() object instance | |
| Token for one-time payment | requestToken() | requestToken() | In Kushki.js Hosted Fields, an object of type CardOptions() must be created, which will contain information about the amount, the type of currency, among other transaction data. |
| amount property in token for one-time payment | String. Amount without breakdown | Object. Allows you to break down the purchase amount by iva, ice, subtotaliva and subtotaliva0. | Transaction amount. |
| months property in token for one-time payment | Integer | Not available | In Kushki.js Hosted Fields, deferrals are now returned in the token (if available for the merchant). |
| Currency property in token for one-time payment | String | String | Currencies available by country. |
| Card object inside the token for one-time payment | Object. Card information such as cardholder name, card number, cvc, etc.) | Not available | In Kushki.js Hosted Fields, the merchant no longer requires handling of sensitive card data information. |
| Callback property in token for one-time payment | Function | Not available | |
| Fields object within token for one-time payment | Not available | Through the CardOptions object instance | The fields object allows you to relate the html div tags with the corresponding ids of the hosted fields to be rendered. |
| isSubscription property in token for one-time payment | Not available | Boolean. Allows you to indicate whether the generated token is for a subscription or not | In Kushki.js Hosted Fields the isSubscription property replaces the implementation of the requestSubscriptionToken() method. |
| preventAutofill property in token for one-time payment | Not available | Boolean. Allows you to prevent hosted fields from being filled in automatically. | |
| styles property in token for one-time payment | Not available | Object. Allows you to modify hosted field styles. | In Kushki.js Hosted Fields, the library allows greater control of styles in fields. |
| Validation via OTP for one-time payment | requestSecureServiceValidation() method | Automatic validation (if applicable) in the requestToken() method. | |
| Getting JWT for 3D Secure validation for one-time payment | requestSecureInit() method | Automatic validation (if applicable) in the requestToken() method. | |
| Validation through 3D Secure for single payment | requestValidate3DS() method | Automatic validation (if applicable) in the requestToken() method. | |
| Deferred for one-time payment | requestDeferred() method | Returned automatically upon consuming the requestToken() method (if available for the merchant). | |
| Information about the bin for one-time payment | requestBinInfo() method | Not available | In Kushki.js Hosted Fields, it is not required to obtain the bin since the validations are done automatically in the requestToken() method. |
| Subscription token | requestSubscriptionToken() | When calling the requestToken() method, the isSubscription property can be sent as true to indicate that the token will be from a subscription. | |
| Currency property in token for subscription | String | String | Currencies available by country. |
| Token card object for subscription | Object. Card information such as cardholder name, card number, cvc, etc.) | Not available | In Kushki.js Hosted Fields, the merchant no longer requires handling of sensitive card data information. |
| Callback property in token for subscription | Function | Not available | |
| Token fields object for subscription | Not available | Through the CardOptions object instance | The fields object allows you to relate the html div tags with the corresponding ids of the hosted fields to be rendered. |
| isSubscription property in token for subscription | Not available | Boolean. Allows you to indicate whether the generated token is for a subscription or not | In Kushki.js Hosted Fields the isSubscription property replaces the implementation of the requestSubscriptionToken() method. |
| preventAutofill property in token for subscription | Not available | Boolean. Allows you to prevent hosted fields from being filled in automatically. | |
| styles property in token for subscription | Not available | Object. Allows you to modify hosted field styles | In Kushki.js Hosted Fields, the library allows greater control of the styles in the fields. |
| OTP validation for subscription | Not available | Automatic validation (if applicable) in the requestToken() method | |
| Getting JWT for 3D Secure validation for subscription | requestSecureInit() method | Automatic validation (if applicable) in the requestToken() method | |
| Validation using 3D Secure for subscription | requestValidate3DS() method | Automatic validation (if applicable) in the requestToken() method | |
| Obtaining the device token for one-click payments | requestDeviceToken() | requestDeviceToken() | |
| Card Async | YES | Not available | |
| Transfer In | YES | Not available | |
| Cash In | YES | Not available | |
| Payouts | YES (transfer, cash) | Only for card payouts |
card.min.js and kushki.min.js libraries.<script> tag. Once imported, you will be able to access the resources described below to create a payment flow with Kushki.kushki.min.js (which brings the necessary code to store your merchant’s credentials) and card.min.js (the module that brings the necessary functionalities for the flow with card payments).KushkiOptions, which allows you to declare the public key of your merchant, as well as being able to select the environment (test or production) through the init() method.import { IKushki, init, KushkiError, KushkiOptions } from "@kushki/js-sdk";
const kushkiOptions : KushkiOptions = {
publicCredentialId: '<public-credential-id>', // This corresponds to the public credential of the merchant
inTest: true
};
const buildKushkiInstance = async () => {
try {
const kushkiInstance : Ikushki = await init(kushkiOptions);
} catch (e: KushkiError) {
console.error(e.message);
}
}| Property | Type | Required | Description | Default | Allowed Values |
|---|---|---|---|---|---|
| publicCredentialId | string | YES | Public ID created for your merchant. | ||
| inTest | boolean | NO | Allows you to indicate the work environment between test or production. | false | true, false |
initCardToken() method, it is required to include the necessary <div> elements to render each hosted field.| Property | Required | Description |
|---|---|---|
| cardholderName_id | YES | hosted field for the cardholder's name. |
| cardNumber_id | YES | hosted field for the cardholder's number. |
| cvv_id | YES | hosted field for the cvv. |
| expirationDate_id | YES | hosted field for the expiration date. |
| deferred_id | NO | hosted field for deferred payments. |
| otp_id | NO | hosted field for OTP validation. |
cardholderNamecardNumberexpirationDatecvvcardholderNamecardNumberexpirationDateCardOptions with transaction information such as the amount, currency, among other parameters.| Property | Type | Required | Description | Allowed Values |
|---|---|---|---|---|
| amount | object | YES (For one-time payments) | Object with detailed transaction amount information. | |
| currency | string | YES | Available currencies by country:
| |
| fields | object | YES | Object to link website containers with hosted fields. | |
| fields.cardNumber.selector | string | YES | Links with the container with id cardNumber_id and renders the field to enter the card number. | |
| fields.cardholderName.selector | string | YES | Links with the container with id cardholderName_id and renders the field to enter the cardholder's name fields. | |
| fields.cvv.selector | boolean | YES | Links with the container with id cvv_id and renders the field to enter the card's cvv. You can skip cvv. | |
| fields.cvv.isRequired | string | NO | Configures whether CVV value entry is required or not. Applies only to subscriptions. | |
| fields.deferred | string | NO | Links with the container with id deferred_id and renders the field to select deferred payments (if applicable). | |
| fields.expirationDate | string | YES | Links with the container with id expirationDate_id and renders the field to enter the card's expiration month and year. | |
| fields.otp.selector | string | NO | Links with the container with id otp_id and renders the field to enter the OTP value (if applicable). | |
| isSubscription | boolean | NO | Allows identifying whether it is a subscription or not. Set as true to generate a scheduled payment or a One-click payment. | true, false |
| preventAutofill | boolean | NO | Allows preventing autofill of hosted fields. | true, false |
| styles | object | NO | Object for declaring custom styles for hosted fields. | |
| styles.cardNumber | CssProperties | NO | Allows modifying the styles of the field to enter the card number. | |
| styles.cardholderName | CssProperties | NO | Allows modifying the styles of the field to enter the cardholder's name. | |
| styles.container | CssProperties | NO | Allows modifying the styles of the input container. | |
| styles.cvv | CssProperties | NO | Allows modifying the styles of the field to enter the card's cvv. | |
| styles.deferred | CssProperties | NO | Allows modifying the styles of the field for deferred payments. | |
| styles.expirationDate | CssProperties | NO | Allows modifying the styles of the field for the card's expiration month and year. | |
| styles.focus | CssProperties | NO | Allows modifying the styles when the field has focus. | |
| styles.input | CssProperties | NO | Allows modifying the input styles. | |
| styles.invalid | CssProperties | NO | Allows modifying the styles when a field is invalid. | |
| styles.label | CssProperties | NO | Allows modifying the styles of the input label. | |
| styles.otp | CssProperties | NO | Allows modifying the styles of the OTP field. | |
| styles.valid | CssProperties | NO | Allows modifying the styles when a field is valid. | |
| fullResponse | boolean | NO | Allows you to obtain additional information when generating a token for subscriptions. |
CardOptions, it is necessary to call the initCardToken() function to initialize an instance of ICard. This function takes the instance created in the Initializing Kushki.js Hosted Fields section and the instance with transaction options created in Step 2. Create a CardOptions Instance as parameters. It returns a promise of the ICard.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Instance with the merchant's public key and working environment. |
| options | CardOptions | YES | Must define the configuration of card fields (set transaction amount, currency, subscription status, autofill prevention, add custom CSS styles, add custom fields). |
initCardToken() function may return:| Code | Message | Example | Description |
|---|---|---|---|
| E012 | Error en inicialización de campos | { code: "E012", message: "Error en inicialización de campos" } | If the parameters options or kushkiInstance are null or undefined, it will return an E012 error. |
| E013 | El Id del contenedor de un input no fue encontrado | { code: "E013", message: "El Id del contenedor de un input no fue encontrado" } | If any field has a non-existing selector in the options.fields parameter, it will return an E013 error. |
requestToken() method on the previously initialized card instance. This method also performs validation by confirming that all fields are correct; otherwise, it will throw an exception.TokenResponse object that you should send to your backend to continue with the payment flow. Next, you need to make a charge with the obtained token.{
"token": "a2b74b7e3cf24e368a20380f16844d16"
}requestToken() method, it will return the following information based on your merchant's country:token, the requestToken() method will return the following fields within the deferred object:creditType: Transaction type.graceMonths: Months of grace.months: Months to defer the transaction.creditType per country:deferred object for merchants in Mexico and Ecuador:{
"token": "a2b74b7e3cf24e368a20380f16844d16",
"deferred": {
"creditType": "03",
"graceMonths": 2,
"months": 12
}
}token, the requestToken() method returns a deferred object. The structure of this object depends on the integration model configured for the merchant:{
"token": "a2b74b7e3cf24e368a20380f16844d16",
"deferred": {
"months": 12
}
}deferred object includes additional parameters required to process the payment correctly:creditType: Returns "03" (Fixed value for Merchant Installments).graceMonths: Returns 0 (Fixed value).months: The number of months selected by the payer.{
"token": "a2b74b7e3cf24e368a20380f16844d16",
"deferred": {
"creditType": "03",
"graceMonths": 0,
"months": 6
}
}| Property | Type | Description |
|---|---|---|
token | String | Token to make a charge. |
deferred | Object | Optional. Object returned if the bin and merchant have deferred enabled. |
deferred.creditType | String | Optional. Type of credit requested. For Chile Cuotas comercio will be 03. |
deferred.graceMonths | String | Optional. Months of grace. • Ecuador: Standard behavior. • Chile Cuotas comercio: Returned only for the Kushki Acquiring model with a fixed value of 0. More information in the Make a charge or deferred charge endpoint. |
deferred.months | Integer | Optional. Number of installments. |
requestToken() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E002 | Token request error | { code: "E002", message: "Error en solicitud de token" } | If there was an error when requesting a token, the error code E002 will be returned. Please validate that the required information has been sent correctly. |
| E003 | Merchant data request error | { code: "E003", message: "Error en solicitud de datos del comercio" } | If there was an error when requesting merchant information. Please try again; if the error persists, contact Kushki support. |
| E004 | JWT request error | { code: "E004", message: "Error en solicitud de JWT" } | If the merchant has a rule for 3D Secure enabled and there was an error requesting the JWT. Please try again; if the error persists, contact Kushki support. |
| E005 | Invalid 3D Secure fields | { code: "E005", message: "Campos 3DS inválidos" } | If the merchant has a rule for 3D Secure enabled and there was an error in the 3D Secure authentication. Please try again, making sure to enter the data correctly for 3D Secure validation. |
| E006 | Token validation request error | { code: "E006", message: "Error en solicitud de validación de token" } | If the merchant has a 3D Secure rule enabled and there was an error in the 3D Secure validation session. Please try again, making sure to enter the data correctly for 3D Secure validation; if the error persists, contact Kushki support. |
| E007 | Form validation error | { code: "E007", message: "Error en la validación del formulario" } | If any hosted field is invalid, the error code E007 will be returned. Please try again, making sure to enter the requested data correctly. |
| E008 | OTP validation error | { code: "E008", message: "Error en la validación de OTP" } | If OTP validation is not correct, the onError callback will return error code E008. Please try again by entering the correct data for OTP validation. |
onOTPValidation() method on the previously created card instance for your Kushki.js hosted fields implementation. This is triggered when a value is entered into the OTP field to validate the code. This method returns three callbacks (onSuccess, onError and onRequired) that allow you to identify the status of OTP validation on the hosted fields.onError or onSuccess callbacks.onRequired (() => void): This callback is executed when the created token requires OTP validation.onError ((error) => void): This callback is executed when OTP validation returns an error.onSuccess (() => void): This callback is executed when OTP validation is successful.onError callback will return the following error messages:| Code | Message | Example | Description |
|---|---|---|---|
| E008 | Error en la validación de OTP | { code: "E008", message: "Error en la validación de OTP" } | If the OTP validation is incorrect, the onError callback will return the error code E008. Please try again by entering the correct data for OTP validation. |
onOTPValidation() events for the OTP hosted field.requestSecureInit() method. This method allows you to obtain a Json Web Token (JWT) which will be required to obtain a card token. Subsequently, call the requestValidate3DS() method, which will display a modal, if necessary, so that the cardholder can carry out the requested challenges.requestSecureInit() method by sending the card number to get a JWT.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
| secureInitRequest | SecureInitRequest | YES | You must define this object in order to request the initialization of 3D Secure. |
requestSecureInit() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E004 | JWT request error | { code: "E004", message: "Error en solicitud de JWT" } | If the merchant has a rule for 3D Secure enabled and there was an error requesting the JWT. Please try again; if the error persists, contact Kushki support. |
| E018 | Longitud de tarjeta inválida (Invalid card length) | { code: "E018", message: "Longitud de tarjeta inválida" } | Please verify that the card length is correct. |
| E019 | Comercio no tiene activo 3DS (Merchant does not have 3DS enabled) | { code: "E019", message: "Comercio no tiene activo 3DS" } | Operation not permitted. Merchant does not have 3D Secure authentication enabled. |
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTQ2NTg0ODgsImlhdCI6MTY1NDY1MTI4OCwiaXNzIjoiNWVhMzJmZDJmZjQ2NDU2OTY3YjUyNDliIiwianRpIjoiZjc4NzQzNTctMmY2Zi00OTExLTg3MDctZDBmN2RlYTZlNTk4IiwiT3JnVW5pdElkIjoiNWVhMzJmZDJhZDA3ZDIxYTM2OTc4OGFlIiwiUmVmZXJlbmNlSWQiOiIyZDdhOTA2OS04MjhjLTQxNDItYWYwNC1hMjZjNWI4YzQ3MjMifQ.5nmFrf3sOAxKNIcJTzc5i2GNY5ALABpu42YsrHIibio"
}{
"card": {
"name": "John Doe",
"number": "4000000000000002",
"expiryMonth": "01",
"expiryYear": "28",
"cvv": "123"
},
"totalAmount": 59,
"currency": "USD",
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTQ2NTg0ODgsImlhdCI6MTY1NDY1MTI4OCwiaXNzIjoiNWVhMzJmZDJmZjQ2NDU2OTY3YjUyNDliIiwianRpIjoiZjc4NzQzNTctMmY2Zi00OTExLTg3MDctZDBmN2RlYTZlNTk4IiwiT3JnVW5pdElkIjoiNWVhMzJmZDJhZDA3ZDIxYTM2OTc4OGFlIiwiUmVmZXJlbmNlSWQiOiIyZDdhOTA2OS04MjhjLTQxNDItYWYwNC1hMjZjNWI4YzQ3MjMifQ.5nmFrf3sOAxKNIcJTzc5i2GNY5ALABpu42YsrHIibio"
}authRequired property within the security object (security.authRequired) returns true, it will be necessary to consume the requestValidate3DS() method to display the modal so that the cardholder can do the corresponding authentication.{
"token": "g9m2XG100000uut73n085881SMOP3bP1",
"secureService": "3dsecure",
"secureId": "61efd064-b9df-4c0c-81fb-5b39a5d0cf9f",
"security": {
"acsURL": "[https://merchantacsstag.cardinalcommerce.com/MerchantACSWeb/pareq.jsp?vaa=b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n0ND0ukTOJIfhfi0",
"authRequired": true,
"paReq": "eNpVUstuwjAQvPsrItRTD7HjhAjQYokWqQVUSksqKm5RYkiU5oFjE/j72iFAK/mws7Nr78wagkRwPl3zSAnO4I3XdbjnVhqPe+p43BZkOSUqC97ns12yS0mPwWryyQ8MjlzUaVkwxyY2BXyFSF8hoiQsJIMwOjzNlszzh9TxAXcQQc7FbMr6nksdAviCEBRhztlivXh8ScpaWitRxiqSpRXwWqYF4JZHEJWqkOLMfOIBvgIESvywRMpqhHHTNHam6iRLq3Bf1nZU5oANjwDfh1spE9Va8ymNWfy9pZvca4Lso4k38isg1XybJ3kYTMaATQWCOJScUUIp8cnAIu5IH1cP0eYRhLkZhj30hzbRsjqIoDIPTS6oPzTU34wWpITgRXRmA09zN4SAn6qy4LpG23uLtYb75M+vxuRIGjd9z3UpNS63uG1PtTXUJ07bn7Y+YdODux3ibt06+vcNfgHbNq5L",
"specificationVersion": "2.2.0"
}
}requestValidate3DS() method in case the transaction needs to be authenticated using 3D Secure. The requestValidate3DS() method receives as a parameter the object obtained when requesting a card token.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
| cardTokenResponse | CardTokenResponse | YES | The response object from the card tokenization process using the API. |
requestValidate3DS() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E005 | Campos 3DS inválidos (Invalid 3DS fields) | { code: "E005", message: "Campos 3DS inválidos" } | If the merchant has a 3D Secure rule enabled and there was an error in the 3D Secure authentication. Please try again making sure to enter the data correctly for the 3D Secure validation. |
| E006 | Error en solicitud de validación de token (Token validation request error) | { code: "E006", message: "Error en solicitud de validación de token" } | If the merchant has a 3D Secure rule enabled and there was an error in the 3D Secure validation session. Please try again making sure to enter correctly the data for the 3D Secure validation, if the error persists contact Kushki support. |
{
"token": "g9m2XG100000uut73n085881SMOP3bP1"
}TokenResponse object will be returned with the error information.{
"code": "E012",
"message": "Error en inicialización de campos"
}requestSecureInit() method and following the steps described above.requestInitAntiFraud() method. This method allows you to obtain a Json Web Token (JWT) which will be required to obtain a card token.requestInitAntiFraud method by sending a Kushki instance with your merchant configuration and customer id.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
| userId | String | YES | Client ID. It can be email, phone number, address or empty. |
requestInitAntiFraud() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E003 | Error en solicitud de datos del comercio (Error in requesting merchant data) | { code: "E003", message: "Error en solicitud de datos del comercio" } | If there was an error requesting merchant information. Please try again if the error persists contact Kushki support. |
| E023 | Error al configurar sesión de Sift | { code: "E023", message: "Error al configurar sesión de Sift" } | Sift configuration error. Please check your Sift settings and try again. |
isSubscription property to true when creating a CardOptions instance.isRequired flag as false inside the object with the settings for the CVV field.CardOptions object.periodicity property with the value of custom to get a subscriptionId.subscriptionId is required. It must have been previously created using the recurring charge API with a token obtained from requestToken, where the isSubscription flag was set to true.requestDeviceToken() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E003 | Merchant data request error | { code: "E003", message: "Error en solicitud de datos del comercio" } | If there was an error when requesting merchant information. Please try again; if the error persists, contact Kushki support. |
| E004 | JWT request error | { code: "E004", message: "Error en solicitud de JWT" } | If the merchant has a rule for 3D Secure enabled and there was an error requesting the JWT. Please try again; if the error persists, contact Kushki support. |
| E005 | Invalid 3DS fields | { code: "E005", message: "Campos 3DS inválidos" } | If the merchant has a rule for 3D Secure enabled and there was an error in the 3D Secure authentication. Please try again, making sure to enter the data correctly for 3D Secure validation. |
| E006 | Token validation request error | { code: "E006", message: "Error en solicitud de validación de token" } | If the merchant has a 3D Secure rule enabled and there was an error in the 3D Secure validation session. Please try again, making sure to enter the data correctly for 3D Secure validation; if the error persists, contact Kushki support. |
| E016 | Error in UserId request for subscription | { code: "E016", message: "Error en solicitud de UserId para subscripción" } | If the merchant has Sift Science configurations and options.subscriptionId into body is not found or the request fails then throw E016 error. Please try again, making sure to enter the requested data correctly. |
| E020 | Merchant data request error | { code: "E020", message: "Error, configuración de campos requeridos no encontrada" } | If DeviceTokenRequest body is not defined, then it throws this error. |
requestDeviceToken() method, you need to call the make an One-click payment endpoint from your backend to perform a One-click payment.Secure DeviceToken method. This is the second method to obtain a deviceToken, but it uses a hosted field to validate the card's CVV.SecureDeviceTokenOptions.| Property | Type | Required | Description | Allowed Values |
|---|---|---|---|---|
| fields.cvv.selector | string | YES | Links with the container with id cvv_id and renders the field to enter the card's cvv. | |
| preventAutofill | boolean | NO | Allows preventing autofill of hosted fields. | true, false |
| styles | Styles | NO | Object for declaring custom styles for hosted fields. |
| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
| options | SecureDeviceTokenOptions | YES | Object to get device token for one-click payment. |
initSecureDeviceToken() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E012 | Error en inicialización de campos | { code: "E012", message: "Error en inicialización de campos" } | If the parameters options or kushkiInstance are null or undefined, it will return an E012 error. |
| E013 | El Id del contenedor de un input no fue encontrado | { code: "E013", message: "El Id del contenedor de un input no fue encontrado" } | If any field has a non-existing selector in the options.fields parameter, it will return an E013 error. |
requestDeviceToken method on your card subscription instance that was previously initialized, this method also validates if the cvv field is valid, otherwise it will throw an exception.TokenResponse object that you will send to you backend and proceed with the charge of one-click payment or subscription on demand.| Property | Type | Description |
|---|---|---|
| token | String | Token to make a charge. |
| cardInfo | Object | Optional. If the fullResponse property is set to true when instantiating CardOptions to create the subscription, this object will be returned with additional information. |
| cardInfo.bin | String | Optional. The card bin (8 digits). |
| cardInfo.brand | String | Optional. The card brand. |
| cardInfo.expirationDate | String | Optional. The card expiration date. |
| cardInfo.lastFourDigits | String | Optional. The card last four digits. |
{
"token": "a2b74b7e3cf24e368a20380f16844d16"
}cardInfo object:{
"token": "a2b74b7e3cf24e368a20380f16844d16",
"cardInfo": {
"bin": "42424242",
"brand": "visa",
"expirationDate": "11/27",
"lastFourDigits": "4242"
}
}CardPayoutOptions object and call the initCardPayoutToken method. This will render the hosted fields on your side, allowing the user to enter their card details and complete the tokenization process. More examples here.isSubscription field is a checkbox, so specific styles must be applied to this input type. For more details, click here.requestCardPayoutToken method on your previously initialized card payout instance. This method also validates whether the fields contain valid values; otherwise, it will throw an exception.CardPayoutTokenResponse object, which you must send to your backend to proceed with the payment or subscription charge. The response type depends on the isSubscription field:isSubscription is checked, the response will be a CardPayoutSubscriptionTokenResponse, which includes a subscriptionId.CardPayoutUniqueTokenResponse, which provides a one-time token.initApplePayButton method enables you to easily render the Apple Pay button and initialize a payment session via the Kushki API.apple-developer-merchantid-domain-association file from Kushki Support (specify if it is for UAT or Production).https://{your-domain}/.well-known/apple-developer-merchantid-domain-association#kushki-apple-pay-button).requestApplePayToken method is a Kushki card token, not an Apple token. This token is pre-processed and ready to be used directly in Kushki’s API to perform a charge card transaction.requestBankList() method. You must send the ID of the selected bank when requesting a transfer token.IKushki object when calling the requestBankList() method to get the complete list of available banks.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
requestBankList() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E014 | Error en solicitud de lista de bancos (Error in bank list request) | { code: "E014", message: "Error en solicitud de lista de bancos" } | If there was an error in obtaining the bank list, the error code E014 will be returned. Please try again making sure to enter the card data correctly, if the error persists contact Kushki support. |
requestBrandsByMerchant() method. This information can be useful to display the payment options available in your store.| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
requestBrandsByMerchant() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E021 | Error en solicitud de marcas de tarjetas del comercio | { code: "E021", message: "Error en solicitud de marcas de tarjetas del comercio" } | Please check the information sent and try again. |
| Property | Type | Required | Description |
|---|---|---|---|
| kushkiInstance | IKushki | YES | Object with public merchant id and work environment. |
| body | CommissionConfigurationRequest | YES | Object with information on the currency and the amount to calculate the commissions. |
requestCommissionConfiguration() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E015 | Error en solicitud de configuración de comisión (Error in commission configuration request) | { code: "E015", message: "Error en solicitud de configuración de comisión" } | If there was an error getting the commission settings for the merchant, error code E015 will be returned. Please try again making sure you submit the required information correctly. |
requestInitCardBrandingAnimation method to render the animation after an approved transaction.| Property | Type | Required | Description |
|---|---|---|---|
| opts | CardBrandingRequest (Visa, Mastercard) | YES | Object with animation settings. |
requestInitCardBrandingAnimation() method can return as a KushkiError object:| Code | Message | Example | Description |
|---|---|---|---|
| E022 | Error al generar animación | { code: "E022", message: "Error al generar animación" } | Please verify that the animation configuration parameters are correct. |