Quick start

Creando la transacción#

Tipo de solicitud: POST

URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions

Headers:

  • Content-Type: application/json
  • merchant_id: {su código de tienda}
  • merchant_key: {clave de su tienda}

Requisição:

{
"merchant_usn": "12042142155",
"order_id": "12042142155",
"installments": "1",
"installment_type": "4",
"authorizer_id": "2",
"amount": "1000",
"payment_js": "true"
}
curl
--request POST "https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/transactions"
--header "Content-Type: application/json"
--header "merchant_id: xxxxxxxx"
--header "merchant_key: xxxxxxxx"
--data-binary
{
"merchant_usn":"12042142155",
"order_id":"12042142155",
"installments":"1",
"installment_type":"4",
"authorizer_id":"2",
"amount":"1000",
"payment_js":"true"
}
--verbose

Respuesta:

{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"status": "NOV",
"nit": "1234567890123456789012345678901234567890123456789012345678901234",
"order_id": "12042142155",
"merchant_usn": "12042142155",
"amount": "1000",
"pay_token": "123456789012345678901234567890123456789012345678901234567890123456"
}
}

Obtenga más información sobre este servicio.

Página de pago de la tienda online#

La página de pago del comerciante debe contener la secuencia de comandos de Portal Carat. A continuación se muestran las URL de descarga:

URL para el entorno de producción:

https://esitef-ec.softwareexpress.com.br/js/esitefpayment-1.0.min.js

URL del entorno de aprobación:

https://esitef-homologacao.softwareexpress.com.br/js/esitefpayment-1.0.min.js

Ejemplo:

A continuación se muestra un ejemplo de una página integrada con el pago de JavaScript Portal Carat:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script
type="text/javascript"
src="https://esitef-
homologacao.softwareexpress.com.br/js/esitefpayment-1.0.min.js"
></script>
<script>
function myPay() {
var request = {
onSuccess: function (response) {
console.log(response.code);
console.log(response.message);
console.log(response.payment.authorizer_code);
console.log(response.payment.authorizer_message);
console.log(response.payment.status);
console.log(response.payment.nit);
console.log(response.payment.order_id);
console.log(response.payment.customer_receipt);
console.log(response.payment.authorizer_id);
},
onFailure: function (response) {
console.log(response.code);
console.log(response.message);
console.log(response.payment.authorizer_code);
console.log(response.payment.authorizer_message);
console.log(response.payment.status);
console.log(response.payment.nit);
console.log(response.payment.order_id);
console.log(response.payment.authorizer_id);
},
onInvalid: function (errors) {
for (var i = 0; i < errors.length; i++) {
console.log(errors[i].field);
console.log(errors[i].cause);
}
},
nit: '1234567890123456789012345678901234567890123456789012345678901234',
payToken:
'123456789012345678901234567890123456789012345678901234567890123456',
merchantId: 'xxxxxxxx',
locale: 'pt',
isCardSecurityCodeOptional: false,
};
esitefDoPayment(request);
}
</script>
</head>
<body>
<form method="POST">
<input type="text" class="esitef-cardnumber" />
<input type="text" class="esitef-cardexpirymonth" />
<input type="text" class="esitef-cardexpiryyear" />
<input type="text" class="esitef-cardsecuritycode" />
<input type="button" onclick="myPay()" />
</form>
</body>
</html>