Receive Wire Transfers

Your customers will be able to use the balance in their bank account to make purchases on your website or application

Web
iOS
Android

Allow your customers to use the available balance in their bank account or in their digital wallet to purchase your products or services from your website. In Ecuador you can process transfers with two processors:

  • Traditional bank transfer: you obtain the basic data of your paying customer and redirect them to the electronic banking system to authorize the debit to their bank account.
  • DeUna!: your customer pays with the balance of their DeUna! account from the app, using a dynamic QR, a deep link or a reference code.

The integration flow is the same in both cases —you tokenize in the front end and start the transaction in the back end— and the only thing that changes is the way your customer completes the payment.

The payment flow with traditional bank transfer that you will integrate is as shown below:

Flujo Pago con transferencia (CL-EC-PE) EN

The payment flow with DeUna! is as shown below:

sequence-transfer-in-deuna-ec-en

1. Set up your Front-end

The front end is responsible for collecting the user’s main data, generating a token for such information through Kushki’s servers, and sending that information to the back end to start the payment process.

You have two options to integrate: Kajita and Kushki.js.

Kajita

Kushki has payment forms ready to collect payment information securely. You can use any of our versions:

  • Cajita: the first version of the predefined payment form. Not customizable.
  • Kajita: the second version. It allows you to customize your payment forms from your Administration Console and even have several versions of Kajita, for example, one for each payment method.

Create and customize your Kajitas

With Kushki you can create your Kajitas from the Administration Console. Click here to learn how to do this.

Set up Kajita

Include the kushki-checkout.js script in your payment page by adding it to the <head> of your HTML file. Always load kushki-checkout directly from cdn.kushkipagos.com. Do not include the script in a bundle or package or host a copy of it.

<head>
<title>Checkout</title>
<script src="https://cdn.kushkipagos.com/kushki-checkout.js"></script>
</head>

Add Kajita to your website

Kajita needs a space within your page. Enter the following code in your website’s <body>, where you want the payment form to be displayed.

For Kajita (v.2):

<form id="my-form" action="/confirm" method="post">
<input type="hidden" name="cart_id" value="123">
</form>

For Cajita (v.1):

<form id="payment-form" action="/confirm" method="post">
<input type="hidden" name="cart_id" value="123">
</form>

Remember to configure the action of the action form according to the corresponding endpoint in your back end, to obtain the token.

Then, add the script tag.

For Kajita (v.2) you can obtain such script from your Administration Console, as explained in Create and customize your Kajitas.

<script type="text/javascript">
var kushki = new KushkiCheckout({
kformId: "HmJXukKb5",
form: "my-form",
publicMerchantId: "${publicCredentialId}", // Replace this with your public key
amount: {
subtotalIva: 0,
iva: 0,
subtotalIva0: 1000
}
});
</script>

For v.1 (Cajita), add the following script, making sure the form has loaded:

<script type="text/javascript">
var kushki = new KushkiCheckout({
form: "payment-form",
merchant_id: "95911a50891s1cb79c0f19dd440b46bd", // Replace this with your Public key
amount: {
subtotalIva: 0, // Set the value to 0 when the Tx has no taxes
iva: 0, // Set the value to 0 when the Tx has no taxes
subtotalIva0: 100, // Set here the total amount of the transaction when it does not have taxes, otherwise set it to 0
ice: 0 // Ecuador only. Set the value to 0 when the Tx has no ICE
},
currency: "USD", // Use the currency of your country: USD, COP, CLP or PEN
payment_methods: ["transfer"], // You will be able to add more payment methods
inTestEnvironment: true, // Configured in test mode
callback_url: "https://return.com" // URL to redirect the user once the payment process has been completed from their bank
});
</script>

This will create a predesigned form on your website to accept payments.

Kushki.js

Use Kushki.js if you need more control over the “look & feel” or appearance of your payment form.

Set up Kushki.js

Option 1 - CDN

Use the following script tag at the end of the <body> of your payment page.

<script src="https://cdn.kushkipagos.com/kushki.min.js"></script>
Option 2 - NPM

Install the package from npm.

npm install --save @kushki/js

Then import it into your code using the following code.

import { Kushki } from "@kushki/js";
Set up the Kushki object

Add the following code to your application

const kushki = new Kushki({
merchantId: 'public-merchant-id', // Your public merchant id
inTestEnvironment: true
});

Collect user information and send it to your back-end

First, embed the form in your payment page adding the required fields. You can design it as you prefer.

For example:

<form id="payment-form">
<input placeholder="Name" type="text" name="name">
<input placeholder="Person type" type="text" name="userType">
<input placeholder="Document type" type="text" name="documentType">
<input placeholder="Email" type="text" name="email">
<input placeholder="Document number" type="text" name="documentNumber">
<input placeholder="Reference" type="text" name="reference">
<input placeholder="Description" type="text" name="description">
<button id="submit">Pay $49.99</button>
</form>

Then, for the moment when the user submits the form, add a token request and send it to your back end.

var callback = function(response) {
if (!response.code) {
console.log(response.token);
} else {
console.error('Error: ', response.error, 'Code: ', response.code, 'Message: ', response.message);
}
}
kushki.requestTransferToken({
callbackUrl: 'http://www.testcallbackurl.com/',
userType: '1',
documentType: 'RUC', // CI, RUC or PAS
documentNumber: '171054019',
paymentDescription: 'Description of the payment.',
email: 'test@test.com',
currency: 'USD',
amount: {
subtotalIva: 0, // Set the value to 0 when the Tx has no taxes
subtotalIva0: 49.99, // Set here the total amount of the transaction when it does not have taxes, otherwise set it to 0
iva: 0, // Set the value to 0 when the Tx has no taxes
extraTaxes: {
propina: 0,
tasaAeroportuaria: 0,
agenciaDeViaje: 0,
iac: 0
}
}
}, callback); // You can also configure the function directly

2. Set up your Back-end

The back end is responsible for receiving the token obtained from your front end and starting the payment process with Kushki.

When the user submits the form, your front end sends a token to an endpoint that you specified previously. Using this token, you must make a call to our charge endpoint to start the charge process.

  • Javascript
  • Python
  • PHP
const request = require("request");
const options = {
method: 'POST',
url: 'https://api-uat.kushkipagos.com/transfer/v1/init', // Test environment
headers: {
'Private-Merchant-Id': '0c0b08cd92fc491fb37365170164f7e9', // Replace this with your Private Key
'content-type': 'application/json'
},
body: {
token: "b1d6f46f88fe4759aad9ae0e37cdf905",
amount: {
subtotalIva: 0,
subtotalIva0: 49.99,
iva: 0,
extraTaxes: {
propina: 0,
tasaAeroportuaria: 0,
agenciaDeViaje: 0,
iac: 0
}
},
metadata: {
userId: "IB344"
}
},
json: true
};
request(options, function(error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
url = "https://api-uat.kushkipagos.com/transfer/v1/init" # Test environment
headers = {
"Private-Merchant-Id": "0c0b08cd92fc491fb37365170164f7e9", # Replace this with your Private Key
"content-type": "application/json"
}
payload = {
"token": "b1d6f46f88fe4759aad9ae0e37cdf905",
"amount": {
"subtotalIva": 0,
"subtotalIva0": 49.99,
"iva": 0,
"extraTaxes": {
"propina": 0,
"tasaAeroportuaria": 0,
"agenciaDeViaje": 0,
"iac": 0
}
},
"metadata": {
"userId": "IB344"
}
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append(json_encode([
'token' => 'b1d6f46f88fe4759aad9ae0e37cdf905',
'amount' => [
'subtotalIva' => 0,
'subtotalIva0' => 49.99,
'iva' => 0,
'extraTaxes' => [
'propina' => 0,
'tasaAeroportuaria' => 0,
'agenciaDeViaje' => 0,
'iac' => 0
]
],
'metadata' => [
'userId' => 'IB344'
]
]));
$request->setRequestUrl('https://api-uat.kushkipagos.com/transfer/v1/init');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders(array(
'Private-Merchant-Id' => '0c0b08cd92fc491fb37365170164f7e9', // Replace this with your Private Key
'content-type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();

Display the payment experience

The response of the transaction init depends on the processor enabled for your merchant.

With traditional bank transfer, redirect the user to the URL that Kushki returns in redirectUrl so that your customer can authenticate in the virtual portal of their bank entity and authorize the transaction amount to be debited from the balance of their bank account.

With DeUna!, the same call returns three new fields, one for each payment experience. A single request returns all three: you decide which one to display, based on the channel your customer is buying through.

  • qr — Dynamic QR, as a Base64 PNG. Best for desktop checkout: the customer scans with their phone.
  • redirectUrl — Deep link that opens the DeUna! app. Best for mobile web or your own app: opens DeUna! in one tap.
  • referenceCode — Reference code the customer types into the app. Alternative when the camera fails or the customer prefers to type.

Render the QR code

The qr field contains a PNG image encoded in Base64, with the data:image/png;base64, prefix already included. You must read the value and render it as an image in your checkout: Kushki does not host the QR image for you.

<!-- The value of `qr` is used directly as the image source -->
<img id="deuna-qr" alt="Scan with DeUna!" />
<script>
document.getElementById("deuna-qr").src = initResponse.qr;
</script>

Display the reference code

The referenceCode field is an alphanumeric key. Treat it as a string and do not restrict the field to digits, or you will reject valid codes.

Display the result of the transaction

Once the payment is completed, the customer will be returned with a GET call to the callbackUrl you specified when requesting the token.

Along with the return URL, we will send the transaction token in the path, with which you can check the status of the transaction using this endpoint. In addition, you will obtain the necessary information for your customer’s payment voucher.

For example, for callbackUrl = 'http://www.example.com' the customer will return to:

GET https://www.example.com/?token=26735cbb653a421ba7138eb515e0ab1d

where token is equal to 26735cbb653a421ba7138eb515e0ab1d

According to the response that you receive from the transaction status, show the user a success or failure screen to inform the customer whether the payment was made correctly or if there was an error.

3. Test your Integration

There are test ID numbers that you can use in the UAT environment to ensure that your integration is ready.

  • Approved Transaction: Any identification number
  • Declined Transaction: 999999990

4. Prepare your Certification

Read the following guidelines for technical certification approval (required to obtain productive account credentials):

  • The calculation of taxes and the total amount must be the correct amount.
  • Messages displayed on the screen should be aligned with Kushki’s responses.
  • All Kushki responses must be saved and recorded (required in case you need support).
  • In the event of successful receipt of the Webhook notification, respond to the request with a statusCode 200, and inform your customer.
  • The “Pay” button is disabled after the first click.
  • If the result of the transaction is Initialized, a new transaction must not be allowed until approved or rejected.
  • Kushki’s logo must be visible for the customer. You can find our logo in several formats here.
  • Make sure to send all the variables required, specified in the API reference.

Accept Webhooks

Manage correctly post-payment events.

Check the status of your transactions

With the token you received from the front end, you will also be able to check the status of transactions through our API.