Quick start

Esta guía muestra el proceso de realización de una recarga, utilizando la interfaz HTML de Portal Carat.

Que necesitarás

  • Registro activo en el entorno de homologación de Portal Carat (obtenido de nuestro equipo de asistencia)
  • Una herramienta capaz de realizar llamadas HTTP, como Postman, REST Client o cURL
  • Una aplicación capaz de recibir llamadas POST HTTPS

Creando la transacción de recarga

** Tipo de solicitud **: POST

URL: https://esitef-homologacao.softwareexpress.com.br/e-sitef/init/json.se

Headers:

  • Content-Type: application/x-www-form-urlencoded

Parámetros do POST:

  • Key/clave: request;
  • Value/valor: objeto JSON;
  • [tipo_de_retorno]: json o xml;

Objeto JSON request mínimo:

{
  "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

Respuesta:

{
  "responseCode": 0,
  "description": "OK. Transaction successful.",
  "url": "https://esitef-homologacao.softwareexpress.com.br/e-sitef/do.se?input['nit']=12345678asdfghjk12345678asdfghjk12345678asdfghjk12345678asdfghjk",
  "nsuesitef": "123451234512345",
  "nit": "12345678asdfghjk12345678asdfghjk12345678asdfghjk12345678asdfghjk"
}

Más información sobre este servicio.

RRedirigir al usuario

Luego, la tienda debe redirigir al usuario a la URL devuelta por Portal Carat en el paso de creación de la transacción.

Recibir un aviso de status

Tan pronto como cambie el status de la transacción, Portal Carat notificará a la tienda con un POST en su URL de status registrado.

@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);
    }

}

Más información sobre este servicio.