Quick start
This guide shows the process of performing a payment, using e-SiTef's HTML interface.
What you'll need
- Active account on e-SiTef's homologation environment (obtained with our support team)
- A tool capable of performing HTTP calls, such as Postman, REST Client or cURL
- An application capable of receiving POST HTTPS calls
Creating a recharge transaction
HTTP method: POST
URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/init/json.se
Headers:
Content-Type:
application/x-www-form-urlencoded
Key:
request
;Value: JSON object;
[response_type]:
json
orxml
;
Basic JSON request example:
{
"recharge_included":"true",
"merchant_id":"xxxxxxxxxx"
}
curl
--request POST "https://esitef-homologacao.softwareexpress.com.br/e-sitef/init/json.se"
--header "Content-Type: application/x-www-form-urlencoded"
-d 'request=%7B%22merchant_id%22%3A%22xxxxxxxxxx%22%2C%22recharge_included%22%3A%22true%22%7D'
--verbose
Response:
{
"responseCode" : 0,
"description" : "OK. Transaction successful.",
"url" : "https://esitef-homologacao.softwareexpress.com.br/e-sitef/do.se?input['nit']=12345678asdfghjk12345678asdfghjk12345678asdfghjk12345678asdfghjk",
"nsuesitef" : "123451234512345",
"nit" : "12345678asdfghjk12345678asdfghjk12345678asdfghjk12345678asdfghjk"
}
Learn more about this service.
Redirecting the user
The store must then redirect the user to the URL returned by e-SiTef in the transaction creation step.
Receiving a status notification
As soon as the transaction status changes, e-SiTef will notify the store with a POST in its registered status URL.
@RestController
public class MyStatusController {
@PostMapping(value = "/mystatus",
consumes = "application/x-www-form-urlencoded; charset=utf-8")
public ResponseEntity<String> myStatus(@RequestParam Map<String, String> request) {
Log.info("status = " + request.get("status"));
// ...
return new ResponseEntity<>("OK", HttpStatus.OK);
}
}