SIU-Sanaviron-Quilmes/version2.11.0/pasarela pagos exceptua sq pagos
Redirección a pasarela de pago exceptuando SQ-Pagos
Para realizar el pago desde un sistema externo sin pasar por SQ Pagos, se tiene que conectar a la API de GCO a los siguiente endopoints.
1. Para el cliente que quiere realizar el pago desde un sistema externo, en primer lugar se tiene que obtener el token JWT pasando como parámetros el tipo y el numero de documento del cliente al endpoint generar_token de GCO:
--header 'Authorization: Basic c3FfYWNhZGVtaWNvOjEyMzQ1Ng==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"tipo_documento":0,
"numero_documento":13131313
}'
Respuesta:
TMsImlhdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.eSHgCqv9X3p3gzwFFjwoCF9hnF8ZfI90dL-fNZd9xMr1fKFd8SDf7Hfn8X5UhxDVOrNZpT9NYRye5CfeiKmQUg"}
2. Una vez que se obtiene el token JWT, se procede que enviar un POST al endpoint de pagar_cuota de GCO, enviando como header y body el token JWT, ademas del token_venta y la url del sistema externo de retorno callback_cobranza_url, para estos casos como las ventas van a estar guardas en el núcleo el parámetro de_nucleo tiene que siempre ir en true .
--header 'X-Requested-With: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsImlhdCI6MT
c0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.eSHgCqv9X3p3gzwFFjwoCF9hnF8ZfI90dL-fNZd9xMr1fKFd8SDf7Hfn8X5UhxDVOrNZpT9NYRye5CfeiKmQUg' \
--header 'Authorization: Basic c3FfYWNhZGVtaWNvOjEyMzQ1Ng==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsIml
hdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.eSHgCqv9X3p3gzwFFjwoCF9hnF8ZfI90dL-fNZd9xMr1fKFd8SDf7Hfn8X5UhxDVOrNZpT9NYRye5CfeiKmQUg",
"parametros": {
"token_venta": "91a303fd-b94f-4826-970a-4b9122eb4070",
"de_nucleo": true,
"callback_cobranza_url": "https://ventas.uunn.edu.ar/91a303fd-b94f-4826-970a-4b9122eb4070"
}
}'
Respuesta:
3. Luego el cliente tiene que ser redireccionado a la url callback_url para efectuar el pago en la pasarela de pagos, una vez realizado el pago, la pasarela le volverá a redireccionar a la url enviada en el endpint anterior pagar_cuota el el parametro callback_cobranza_url.

