{
  "_type": "export",
  "__export_format": 4,
  "__export_date": "2026-08-12T18:00:00.000Z",
  "__export_source": "novasis-pay:dpago-collection",
  "resources": [
    {
      "_id": "wrk_dpago_novasis",
      "_type": "workspace",
      "name": "Dpago + Novasis Pay",
      "description": "Pruebas de integración Dpago (directo) y del gateway Novasis Pay. Los requests de 'Dpago directo' ya traen el token SHA256 calculado, corren tal cual.",
      "scope": "collection"
    },
    {
      "_id": "env_base_dpago",
      "_type": "environment",
      "parentId": "wrk_dpago_novasis",
      "name": "Base",
      "data": {
        "apiDpago": "https://api.dpago.com",
        "publicToken": "pk_dev_f6a2a5ad7da45a706271d132f922409768a404d1",
        "privateToken": "sk_dev_41375df47a4739929380145adf4f6bc3d90aa5b2",
        "commerceId": 829,
        "refDpago": "PEGAR_EL_reference_QUE_DEVUELVE_DPAGO",
        "gatewayBase": "http://localhost:3010/v1",
        "adminEmail": "admin@novasis.com",
        "adminPassword": "TuPassword123",
        "secretKey": "PEGAR_sk_test_DEL_GATEWAY",
        "customerId": "PEGAR_cus_DEL_GATEWAY",
        "intentId": "PEGAR_pi_DEL_GATEWAY",
        "publicCheckoutToken": "PEGAR_publicToken_DE_LA_SESION"
      },
      "metaSortKey": 1
    },
    {
      "_id": "fld_dpago_directo",
      "_type": "request_group",
      "parentId": "wrk_dpago_novasis",
      "name": "1 · Dpago directo (para soporte)",
      "description": "Le pega DIRECTO a https://api.dpago.com. Corré 'Crear transacción' y mostrale a soporte la respuesta: esperamos redirectUrl y/o qrInformation. token = SHA256(reference + amount + publicToken).",
      "metaSortKey": -100
    },
    {
      "_id": "req_dpago_qrueno",
      "_type": "request",
      "parentId": "fld_dpago_directo",
      "name": "Crear transacción — QR Ueno (platformId 18)",
      "description": "Token ya calculado para reference=INSOMNIA-QRUENO-1, amount=150000. Si cambiás monto o reference, recalculá el token (ver README de la colección).",
      "method": "POST",
      "url": "{{ _.apiDpago }}/transactions",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"amount\": 150000,\n  \"description\": \"Prueba Insomnia QR Ueno\",\n  \"reference\": \"INSOMNIA-QRUENO-1\",\n  \"withInvoice\": false,\n  \"customer\": {\n    \"email\": \"cliente@example.com\",\n    \"identification\": \"1234567\",\n    \"name\": \"Juan Perez\",\n    \"phone\": \"0981123456\"\n  },\n  \"token\": \"13c14ffdd6aaf234fd89dfaedd1ebba6b2b9e331bcd54fa35f1cb8396b3c32c7\",\n  \"platformId\": 18,\n  \"commerceId\": 829,\n  \"orderNumber\": \"INSOMNIA-QRUENO-1\"\n}"
      },
      "headers": [{ "name": "Content-Type", "value": "application/json" }],
      "metaSortKey": -100
    },
    {
      "_id": "req_dpago_pix",
      "_type": "request",
      "parentId": "fld_dpago_directo",
      "name": "Crear transacción — Pix (platformId 14)",
      "description": "Token ya calculado para reference=INSOMNIA-PIX-1, amount=150000.",
      "method": "POST",
      "url": "{{ _.apiDpago }}/transactions",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"amount\": 150000,\n  \"description\": \"Prueba Insomnia Pix\",\n  \"reference\": \"INSOMNIA-PIX-1\",\n  \"withInvoice\": false,\n  \"customer\": {\n    \"email\": \"cliente@example.com\",\n    \"identification\": \"1234567\",\n    \"name\": \"Juan Perez\",\n    \"phone\": \"0981123456\"\n  },\n  \"token\": \"e01a2388e844ca7157ccb51c2e8f575bd706566d4047d249378d9b6faeed7c1e\",\n  \"platformId\": 14,\n  \"commerceId\": 829,\n  \"orderNumber\": \"INSOMNIA-PIX-1\"\n}"
      },
      "headers": [{ "name": "Content-Type", "value": "application/json" }],
      "metaSortKey": -90
    },
    {
      "_id": "req_dpago_status",
      "_type": "request",
      "parentId": "fld_dpago_directo",
      "name": "Estado de transacción",
      "description": "Pegá en la env var refDpago el 'reference' que devolvió Dpago al crear.",
      "method": "GET",
      "url": "{{ _.apiDpago }}/transactions/{{ _.refDpago }}",
      "headers": [{ "name": "Content-Type", "value": "application/json" }],
      "metaSortKey": -80
    },
    {
      "_id": "req_dpago_link",
      "_type": "request",
      "parentId": "fld_dpago_directo",
      "name": "Crear link de pago (funciona en DEV)",
      "description": "POST /links: genera un link para compartir. NO usa token ni customer. La respuesta trae 'link' (URL a compartir), 'code' y 'id'. isTest=true = ambiente de prueba. Vence a los 30 días.",
      "method": "POST",
      "url": "{{ _.apiDpago }}/links",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"commerceId\": 829,\n  \"amount\": 150000,\n  \"description\": \"Prueba Insomnia link de pago\",\n  \"commerceReference\": \"INSOMNIA-LINK-1\",\n  \"isTest\": true\n}"
      },
      "headers": [{ "name": "Content-Type", "value": "application/json" }],
      "metaSortKey": -75
    },
    {
      "_id": "req_dpago_token_helper",
      "_type": "request",
      "parentId": "fld_dpago_directo",
      "name": "▶ Cómo recalcular el token (leer descripción)",
      "description": "Para otros reference/amount: token = SHA256(reference + amount + publicToken). En una terminal:  node -e \"console.log(require('crypto').createHash('sha256').update('MI_REFERENCE'+'MI_AMOUNT'+'pk_dev_f6a2a5ad7da45a706271d132f922409768a404d1').digest('hex'))\"  — amount es el entero (150000), sin decimales.",
      "method": "GET",
      "url": "{{ _.apiDpago }}",
      "metaSortKey": -70
    },
    {
      "_id": "fld_gateway",
      "_type": "request_group",
      "parentId": "wrk_dpago_novasis",
      "name": "2 · Novasis Pay gateway (flujo real)",
      "description": "Flujo completo por el gateway (que calcula el hash internamente). Orden: Login → Crear customer → Crear intent → Confirmar → (Métodos). Copiá los IDs de cada respuesta a las env vars.",
      "metaSortKey": -50
    },
    {
      "_id": "req_gw_login",
      "_type": "request",
      "parentId": "fld_gateway",
      "name": "1) Login admin → accessToken",
      "description": "Copiá accessToken si vas a crear merchant/api-keys. Para el flujo de cobro alcanza con la secretKey (sk_test_) ya cargada en la env.",
      "method": "POST",
      "url": "{{ _.gatewayBase }}/admin/auth/login",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"email\": \"{{ _.adminEmail }}\",\n  \"password\": \"{{ _.adminPassword }}\"\n}"
      },
      "headers": [{ "name": "Content-Type", "value": "application/json" }],
      "metaSortKey": -100
    },
    {
      "_id": "req_gw_customer",
      "_type": "request",
      "parentId": "fld_gateway",
      "name": "2) Crear customer → copiar id a customerId",
      "description": "Dpago exige customer completo. Copiá el 'id' (cus_...) a la env var customerId.",
      "method": "POST",
      "url": "{{ _.gatewayBase }}/customers",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"email\": \"cliente@example.com\",\n  \"name\": \"Juan Perez\",\n  \"docType\": \"ci\",\n  \"docNumber\": \"1234567\",\n  \"phone\": \"0981123456\",\n  \"country\": \"PY\"\n}"
      },
      "headers": [
        { "name": "Content-Type", "value": "application/json" },
        { "name": "Authorization", "value": "Bearer {{ _.secretKey }}" }
      ],
      "metaSortKey": -90
    },
    {
      "_id": "req_gw_intent",
      "_type": "request",
      "parentId": "fld_gateway",
      "name": "3) Crear intent (dpago + platformId) → copiar id a intentId",
      "description": "platformId 18 = QR Ueno, 14 = Pix. Copiá el 'id' (pi_...) a la env var intentId.",
      "method": "POST",
      "url": "{{ _.gatewayBase }}/payment-intents",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"amount\": 150000,\n  \"currency\": \"PYG\",\n  \"country\": \"PY\",\n  \"requestedProvider\": \"dpago\",\n  \"platformId\": \"18\",\n  \"description\": \"Prueba Insomnia\",\n  \"customerId\": \"{{ _.customerId }}\"\n}"
      },
      "headers": [
        { "name": "Content-Type", "value": "application/json" },
        { "name": "Authorization", "value": "Bearer {{ _.secretKey }}" }
      ],
      "metaSortKey": -80
    },
    {
      "_id": "req_gw_confirm",
      "_type": "request",
      "parentId": "fld_gateway",
      "name": "4) Confirmar intent → devuelve qr/redirectUrl",
      "description": "El gateway llama a Dpago. Mirá attempt.redirectUrl (link) y attempt.qr (QR inline si viene).",
      "method": "POST",
      "url": "{{ _.gatewayBase }}/payment-intents/{{ _.intentId }}/confirm",
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"platformId\": \"18\"\n}"
      },
      "headers": [
        { "name": "Content-Type", "value": "application/json" },
        { "name": "Authorization", "value": "Bearer {{ _.secretKey }}" }
      ],
      "metaSortKey": -70
    },
    {
      "_id": "req_gw_methods",
      "_type": "request",
      "parentId": "fld_gateway",
      "name": "5) (Opcional) Métodos disponibles de una checkout session",
      "description": "Necesita una checkout session creada. Pegá su publicToken en la env var publicCheckoutToken. Sin auth.",
      "method": "GET",
      "url": "{{ _.gatewayBase }}/public/checkout-sessions/{{ _.publicCheckoutToken }}/payment-methods",
      "metaSortKey": -60
    }
  ]
}
