Diferencia entre revisiones de «SIU-Sanaviron-Quilmes/version2.10.0/pasarela pagos exceptua sq pagos»

De SIU
Saltar a: navegación, buscar
(Respuesta:)
Línea 22: Línea 22:
 
</source>
 
</source>
  
===Respuesta:===
+
'''Respuesta:'''
  
 
<source lang="php" enclose="div">
 
<source lang="php" enclose="div">
Línea 47: Línea 47:
 
}'
 
}'
 
</source>
 
</source>
 
  
 
===Respuesta:===
 
===Respuesta:===

Revisión del 11:55 24 sep 2025

ISOSIU-SQ.png


< Volver

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:

curl --location --request POST 'https://desarrollo.siu.local/sq_pagos_backend/generar_token' \
--header 'Authorization: Basic c3FfYWNhZGVtaWNvOjEyMzQ1Ng==' \
--header 'Content-Type: text/plain' \
--data-raw '{
"tipo_documento":0,
"numero_documento":13131313
}'

Respuesta:

{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsImlhdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.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 .

curl --location --request POST 'https://desarrollo.siu.local/sq_pagos_backend/portal/pagar_cuota' \
--header 'X-Requested-With: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsImlhdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.eSHgCqv9X3p3gzwFFjwoCF9hnF8ZfI90dL-fNZd9xMr1fKFd8SDf7Hfn8X5UhxDVOrNZpT9NYRye5CfeiKmQUg' \
--header 'Authorization: Basic c3FfYWNhZGVtaWNvOjEyMzQ1Ng==' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsImlhdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.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:

 {"callback_url":{"url":"https://www.mercadopago.com.ar/checkout/v1/redirect?pref_id=664554742-46659928-d47a-4061-94bb-091757d1da08"}}

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.