{
  "info": {
    "_postman_id": "8f3d2a10-1c01-4d4c-a9ab-9b6a1c2e3f01",
    "name": "JAD Payment API",
    "description": "Postman collection for the JAD Payment API (sandbox at https://svc.jadx.cash).\n\n## Quick start\n1. Open the collection's **Variables** tab and set `clientSecret` (and `clientId` if different from the default test client).\n2. Run **Auth → Get Token** — its test script stores `accessToken` in the collection variables automatically. Every other request inherits the Bearer token from the collection-level auth.\n3. Run any **Card** or **Wallet** request. Two-step flows chain automatically: the **Authorize** requests save `cardAuthId` / `walletAuthId`, which the **Capture** and **Void** requests then reference.\n\n## Notes\n- Currency: **XCD only** on the current sandbox merchant.\n- Card test PAN: `4111111111111111` (Visa sandbox).\n- Wallet payer: defaults to `moziz@hotmail.com` (must be provisioned with sub-accounts + funded XCD balance).\n- **Refund** is a review-queue case in both rails — it does NOT move money until staff approval.\n- All requests other than Get Token require the Bearer token (inherited).\n\nSee `wwwroot/docs/index.html` (the developer guide) for the full lifecycle and money-movement reference.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      { "key": "token", "value": "{{accessToken}}", "type": "string" }
    ]
  },
  "variable": [
    { "key": "baseUrl", "value": "https://svc.jadx.cash", "type": "string" },
    { "key": "clientId", "value": "5DT3Y.1730472331", "type": "string" },
    { "key": "clientSecret", "value": "", "type": "string" },
    { "key": "accessToken", "value": "", "type": "string" },
    { "key": "payerEmail", "value": "jane.doe@example.com", "type": "string" },
    { "key": "walletEmail", "value": "moziz@hotmail.com", "type": "string" },
    { "key": "cardAuthId", "value": "", "type": "string" },
    { "key": "cardSaleId", "value": "", "type": "string" },
    { "key": "walletAuthId", "value": "", "type": "string" },
    { "key": "walletSaleId", "value": "", "type": "string" }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Get Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const json = pm.response.json();",
                  "  if (json.accessToken) {",
                  "    pm.collectionVariables.set('accessToken', json.accessToken);",
                  "    console.log('accessToken stored:', json.accessToken.substring(0, 20) + '...');",
                  "    pm.test('accessToken returned', () => pm.expect(json.accessToken).to.be.a('string').and.not.empty);",
                  "  } else {",
                  "    console.warn('No accessToken in response', json);",
                  "    pm.test('accessToken returned', () => pm.expect.fail('No accessToken in response body'));",
                  "  }",
                  "} catch (e) { console.error('Token extraction failed', e); }"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                { "key": "grant_type", "value": "client_credentials", "type": "text" },
                { "key": "client_id", "value": "{{clientId}}", "type": "text" },
                { "key": "client_secret", "value": "{{clientSecret}}", "type": "text" },
                { "key": "scope", "value": ".default", "type": "text" }
              ]
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/auth/token",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "auth", "token"]
            },
            "description": "OAuth2 client_credentials flow. Stores the returned `accessToken` into the collection variable for all subsequent requests.\n\nCredentials can also be supplied via the `Authorization: Basic base64(clientId:clientSecret)` header — supported by RFC 6749 — if you'd rather not put the secret in the body."
          }
        }
      ]
    },
    {
      "name": "Card",
      "item": [
        {
          "name": "Authorize",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const json = pm.response.json();",
                  "  if (json && json.id) {",
                  "    pm.collectionVariables.set('cardAuthId', json.id);",
                  "    console.log('cardAuthId stored:', json.id);",
                  "  }",
                  "} catch (e) {}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-AUTH-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"address2\": \"Apt 2\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/authorize",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "authorize"]
            },
            "description": "Authorize a card payment (no capture). On success returns `id` (the CyberSource transaction id), saved here as `cardAuthId` for use by Capture and Void."
          }
        },
        {
          "name": "Sale (authorize + capture)",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const json = pm.response.json();",
                  "  if (json && json.id) {",
                  "    pm.collectionVariables.set('cardSaleId', json.id);",
                  "    console.log('cardSaleId stored:', json.id);",
                  "  }",
                  "} catch (e) {}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-SALE-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"address2\": \"Apt 2\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/sale",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "sale"]
            },
            "description": "Authorize + capture in one call. Use for instant-fulfillment scenarios. Stores `cardSaleId` for status lookup and refund."
          }
        },
        {
          "name": "Capture (uses cardAuthId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-AUTH-followup-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/capture/{{cardAuthId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "capture", "{{cardAuthId}}"]
            },
            "description": "Capture a previously-authorized card payment. `{cardAuthId}` is the `id` returned by Authorize."
          }
        },
        {
          "name": "Void authorization (uses cardAuthId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-VOID-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"reason\": \"Customer cancelled before settlement\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/voidAuthorization/{{cardAuthId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "voidAuthorization", "{{cardAuthId}}"]
            },
            "description": "Void (reverse) an uncaptured authorization. Returns `status: REVERSED` on success. Cannot be used after capture or on a sale — use Refund for those."
          }
        },
        {
          "name": "Payment status (uses cardSaleId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/payment/status/{{cardSaleId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "payment", "status", "{{cardSaleId}}"]
            },
            "description": "Look up a transaction's current state via CyberSource TSS. Note: TSS has a short indexing delay — a fresh transaction may return 404 for a few seconds before becoming searchable."
          }
        },
        {
          "name": "Refund case (uses cardSaleId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"developerID\": 1001,\n  \"refundType\": \"customer-request\",\n  \"refID\": \"{{cardSaleId}}\",\n  \"developerNotes\": \"Customer reported duplicate charge; requesting full refund.\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/card/refund",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "card", "refund"]
            },
            "description": "Files a refund request that JAD staff review and approve. **No money moves until approval.** Returns a case reference."
          }
        }
      ]
    },
    {
      "name": "Wallet",
      "item": [
        {
          "name": "Authorize",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const json = pm.response.json();",
                  "  if (json && json.id) {",
                  "    pm.collectionVariables.set('walletAuthId', json.id);",
                  "    console.log('walletAuthId stored:', json.id);",
                  "  }",
                  "} catch (e) {}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-WAUTH-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Moz\",\n  \"lastName\": \"Test\",\n  \"address1\": \"1 Bay Road\",\n  \"address2\": \"Apt 2\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{walletEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/authorize",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "authorize"]
            },
            "description": "Authorize a wallet payment — holds funds from the payer (identified by email). Returns `id` (the parity), saved as `walletAuthId` for use by Capture and Void."
          }
        },
        {
          "name": "Sale",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const json = pm.response.json();",
                  "  if (json && json.id) {",
                  "    pm.collectionVariables.set('walletSaleId', json.id);",
                  "    console.log('walletSaleId stored:', json.id);",
                  "  }",
                  "} catch (e) {}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-WSALE-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Moz\",\n  \"lastName\": \"Test\",\n  \"address1\": \"1 Bay Road\",\n  \"address2\": \"Apt 2\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{walletEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/sale",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "sale"]
            },
            "description": "Wallet sale — funds move from payer to payee in one step. Payer is identified by email and must have a sufficient spendable balance in XCD."
          }
        },
        {
          "name": "Capture (uses walletAuthId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-WAUTH-followup-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"email\": \"{{walletEmail}}\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/capture/{{walletAuthId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "capture", "{{walletAuthId}}"]
            },
            "description": "Transfers the held funds to the payee. `{walletAuthId}` is the parity returned by the matching Authorize."
          }
        },
        {
          "name": "Void authorization (uses walletAuthId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"code\": \"JAD-WVOID-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"email\": \"{{walletEmail}}\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/voidAuthorization/{{walletAuthId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "voidAuthorization", "{{walletAuthId}}"]
            },
            "description": "Releases the held funds back to the payer. Use only on an uncaptured authorization."
          }
        },
        {
          "name": "Payment status (uses walletSaleId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/payment/status/{{walletSaleId}}",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "payment", "status", "{{walletSaleId}}"]
            },
            "description": "Look up the status of a wallet transaction by its parity."
          }
        },
        {
          "name": "Refund case (uses walletSaleId)",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"developerID\": 1001,\n  \"refundType\": \"customer-request\",\n  \"refID\": \"{{walletSaleId}}\",\n  \"developerNotes\": \"Customer reported duplicate charge; requesting full refund.\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/payments/wallet/refundPayment",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "payments", "wallet", "refundPayment"]
            },
            "description": "Files a refund case for a wallet payment. No money moves until staff approval."
          }
        }
      ]
    },
    {
      "name": "Tests",
      "description": "Negative-test variants organized by category. Each request has an assertion script in the **Test Results** tab. Right-click a sub-folder and choose **Run folder** to execute every test in that category and see a pass/fail summary.\n\nThe matrix at `/docs/test-matrix.html` gives the full context for each test number.",
      "item": [
        {
          "name": "Validation (Card · Tier 1)",
          "item": [
            {
              "name": "#7 Sale — missing cardNumber → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));",
                "pm.test('mentions cardNumber', () => pm.expect(pm.response.text().toLowerCase()).to.include('card'));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-7-{{$timestamp}}\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#8 Sale — cardNumber too short → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-8-{{$timestamp}}\",\n  \"cardNumber\": \"411111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#10 Sale — expMonth 13 → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-10-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"13\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#11 Sale — expYear past → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-11-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2020\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#12 Sale — invalid email → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-12-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"not-an-email\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#14 Sale — currency lowercase → 400",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 400', () => pm.response.to.have.status(400));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"VTEST-14-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"xcd\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            }
          ]
        },
        {
          "name": "Business (Card · Tier 1-2)",
          "item": [
            {
              "name": "#20 Sale — totalAmount 'abc' → 200 'Invalid total amount'",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200 (B1/B2 quirk: logical failures return 200 today)', () => pm.response.to.have.status(200));",
                "pm.test('status is \"Invalid total amount\"', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('Invalid total amount');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"BTEST-20-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"abc\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#19 Sale — address2 omitted → 200 AUTHORIZED (proves optional)",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
                "pm.test('status is AUTHORIZED (address2 is optional)', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('AUTHORIZED');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"BTEST-19-{{$timestamp}}\",\n  \"cardNumber\": \"4111111111111111\",\n  \"expMonth\": \"12\",\n  \"expYear\": \"2031\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{payerEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            }
          ]
        },
        {
          "name": "Lifecycle (Card · Tier 1)",
          "item": [
            {
              "name": "#30 Status — random id → 404",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 404 (CyberSource NOT_FOUND)', () => pm.response.to.have.status(404));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/payment/status/0000000000000000000000", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "payment", "status", "0000000000000000000000"] }
              }
            },
            {
              "name": "#26 Void — random id → 4xx",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 4xx (cannot void unknown id)', () => pm.expect(pm.response.code).to.be.within(400, 499));"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"LTEST-26-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"reason\": \"Negative test — random id, expect 4xx\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/voidAuthorization/0000000000000000000000", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "voidAuthorization", "0000000000000000000000"] }
              }
            }
          ]
        },
        {
          "name": "Auth & Security (Tier 1)",
          "item": [
            {
              "name": "#32 Sale — no Authorization header → 401",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 401', () => pm.response.to.have.status(401));"
              ]}}],
              "request": {
                "auth": { "type": "noauth" },
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#33 Sale — garbage Bearer → 401",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 401', () => pm.response.to.have.status(401));"
              ]}}],
              "request": {
                "auth": { "type": "bearer", "bearer": [{ "key": "token", "value": "not.a.real.token", "type": "string" }] },
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/card/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "card", "sale"] }
              }
            },
            {
              "name": "#36 Token — unknown client_id → 401",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 401', () => pm.response.to.have.status(401));"
              ]}}],
              "request": {
                "auth": { "type": "noauth" },
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "urlencoded",
                  "urlencoded": [
                    { "key": "grant_type", "value": "client_credentials", "type": "text" },
                    { "key": "client_id", "value": "NOT_A_REAL_CLIENT", "type": "text" },
                    { "key": "client_secret", "value": "anything", "type": "text" },
                    { "key": "scope", "value": ".default", "type": "text" }
                  ]
                },
                "url": { "raw": "{{baseUrl}}/api/v1/auth/token", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "token"] }
              }
            },
            {
              "name": "#35 Token — wrong secret (today: 200 — bug #1 / after fix: 401)",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "// While #1 (client-secret verification) remains disabled, this returns 200.",
                "// After #1 is enabled in production, the expected result is 401.",
                "pm.test('Either 200 (bug #1 present) or 401 (after fix)', () => {",
                "  pm.expect([200, 401]).to.include(pm.response.code);",
                "});"
              ]}}],
              "request": {
                "auth": { "type": "noauth" },
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "urlencoded",
                  "urlencoded": [
                    { "key": "grant_type", "value": "client_credentials", "type": "text" },
                    { "key": "client_id", "value": "{{clientId}}", "type": "text" },
                    { "key": "client_secret", "value": "WRONG_SECRET_FOR_TEST", "type": "text" },
                    { "key": "scope", "value": ".default", "type": "text" }
                  ]
                },
                "url": { "raw": "{{baseUrl}}/api/v1/auth/token", "host": ["{{baseUrl}}"], "path": ["api", "v1", "auth", "token"] }
              }
            }
          ]
        },
        {
          "name": "Wallet edge (Tier 1-2)",
          "item": [
            {
              "name": "#46 Wallet Sale — missing email → 'Invalid username'",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
                "pm.test('status is \"Invalid username\"', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('Invalid username');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"WTEST-46-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Moz\",\n  \"lastName\": \"Test\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/wallet/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "wallet", "sale"] }
              }
            },
            {
              "name": "#47 Wallet Sale — unknown email → 'Invalid user'",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
                "pm.test('status is \"Invalid user\"', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('Invalid user');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"WTEST-47-{{$timestamp}}\",\n  \"totalAmount\": \"10.00\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Moz\",\n  \"lastName\": \"Test\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"does-not-exist-in-jad@example.com\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/wallet/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "wallet", "sale"] }
              }
            },
            {
              "name": "#49 Wallet Sale — totalAmount 'abc' → 'Invalid total amount'",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
                "pm.test('status is \"Invalid total amount\"', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('Invalid total amount');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{\n  \"code\": \"WTEST-49-{{$timestamp}}\",\n  \"totalAmount\": \"abc\",\n  \"currency\": \"XCD\",\n  \"firstName\": \"Moz\",\n  \"lastName\": \"Test\",\n  \"address1\": \"1 Bay Road\",\n  \"state\": \"St. Kitts\",\n  \"postalCode\": \"KN0101\",\n  \"country\": \"Saint Kitts and Nevis\",\n  \"email\": \"{{walletEmail}}\",\n  \"phoneNumber\": \"+18695551234\"\n}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/wallet/sale", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "wallet", "sale"] }
              }
            },
            {
              "name": "#54 Wallet Status — random parity → 'Not Found'",
              "event": [{ "listen": "test", "script": { "type": "text/javascript", "exec": [
                "pm.test('HTTP 200', () => pm.response.to.have.status(200));",
                "pm.test('status is \"Not Found\"', () => {",
                "  const j = pm.response.json();",
                "  pm.expect(j.status).to.equal('Not Found');",
                "});"
              ]}}],
              "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": { "mode": "raw", "raw": "{}", "options": { "raw": { "language": "json" } } },
                "url": { "raw": "{{baseUrl}}/api/v1/payments/wallet/payment/status/00000000000000", "host": ["{{baseUrl}}"], "path": ["api", "v1", "payments", "wallet", "payment", "status", "00000000000000"] }
              }
            }
          ]
        }
      ]
    }
  ]
}
