<!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>