Diferencia entre revisiones de «SIU-Sanaviron-Quilmes/version2.10.0/pasarela pagos exceptua sq pagos»
(Página creada con «<span style="float: right; margin: 0 0 15px 15px;">{{TOClimit|5}}</span> <span style="float: right; margin: 0 0 15px 15px;">Archivo:ISOSIU-SQ.png|derecha|60px||derecha|li...») |
(→Redirección a pasarela de pago exceptuando SQ-Pagos) |
||
| Línea 4: | Línea 4: | ||
= Redirección a pasarela de pago exceptuando 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: | ||
| + | |||
| + | |||
| + | <source lang="php" enclose="div">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 | ||
| + | }' | ||
| + | </source> | ||
| + | |||
| + | === Respuesta: === | ||
| + | |||
| + | <source lang="php" enclose="div"> | ||
| + | {"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJ0aXBvX2RvY3VtZW50byI6MCwibnVtZXJvX2RvY3VtZW50byI6MTMxMzEzMTMsImlhdCI6MTc0ODQ2OTM1OSwiZXhwIjoxNzQ4NDY5NjU5fQ.eSHgCqv9X3p3gzwFFjwoCF9hnF8ZfI90dL-fNZd9xMr1fKFd8SDf7Hfn8X5UhxDVOrNZpT9NYRye5CfeiKmQUg"} | ||
| + | </source> | ||
| + | |||
| + | |||
| + | |||
| + | 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 . | ||
| + | |||
| + | <source lang="php" enclose="div"> | ||
| + | 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" | ||
| + | } | ||
| + | }' | ||
| + | </source> | ||
| + | |||
| + | |||
| + | === Respuesta: === | ||
| + | |||
| + | <source lang="php" enclose="div"> | ||
| + | {"callback_url":{"url":"https://www.mercadopago.com.ar/checkout/v1/redirect?pref_id=664554742-46659928-d47a-4061-94bb-091757d1da08"}} | ||
| + | </source> | ||
| + | |||
| + | |||
| + | 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. | ||
Revisión del 11:45 24 sep 2025
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:
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.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:
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.

