{
  "$schema": "../cases.schema.json",
  "format": 1,
  "domain": "pixPayload",
  "title": {
    "en": "Pix payload (BR Code)",
    "pt-BR": "Pix copia e cola (BR Code)"
  },
  "functions": [
    {
      "id": "pixPayload.generate",
      "level": "extended",
      "summary": "Generates the payload of a Pix BR Code, the string behind a Pix QR Code and behind \"Pix copia e cola\".",
      "description": "Generates a Pix BR Code payload. Give exactly one of a key (static) or a PSP URL (dynamic), otherwise the function returns `null`.\n\n- `params` (`GeneratePixPayloadParams`): `key` or `url` (exactly one), `merchantName` and `merchantCity` (required), and the optional `amount`, `txid` and `description`. A value that is not an object returns `null`.\n- With `key` the payload is static (object `01` is left out, so it can be paid more than once) and the key is normalized as `pixKey.getInfo` does. A key that `pixKey.getInfo` rejects returns `null`, so an email key with `&` returns `null`.\n- With `url` the payload is dynamic (Point of Initiation `12`) and cannot carry an `amount` or a `txid`: either returns `null`. `url` is the PSP location (field 26-25): a host optionally followed by a path, no scheme (`pix.example.com/qr/v2/1234`), at most 77 characters. The host has dot-separated labels of letters, digits and hyphens (a hyphen never starts or ends a label) with at least one dot, and the path takes only URL path characters (a `%` only as the start of a percent-encoded octet, `%41`). A scheme (`https://...`), a port, a query string, whitespace, a host without a dot, or an empty or non-string `url` returns `null`.\n- `merchantName` and `merchantCity` are required: `null` when either is missing, blank or empty after folding. They are folded to printable ASCII (accents dropped), truncated to 25 and 15 characters, and trimmed after the truncation.\n- `amount` is written with two decimal places. A value that does not survive that (`0.005`, `123.456`), or that is zero, negative, not finite or longer than 13 characters once written (`9999999999.99` is the largest) returns `null`. Floating-point noise beyond the second decimal, as in `0.1 + 0.2` (written `0.30`), is accepted.\n- `txid` is 1 to 25 letters and digits (default `***`, always written in field 62-05). Anything else, `***` included, returns `null`.\n- `description` loses its accents as the name and city do. It is written in field 26-02, in whatever room is left of the 99 characters of the template after the GUI and the key or URL, and never over 72 characters, trimmed after the truncation, and dropped when nothing is left.\n- Every payload the function returns is one `pixPayload.isValid` accepts: the key in its DICT form, the 62-05 txid always written, the name and city within their limits and an amount greater than zero, and `pixPayload.getInfo` reads it back.\n- Pix Saque (`fss`), unreserved templates (IDs 80 to 99) and composite Pix Automático QR Codes are never written.",
      "params": [
        {
          "name": "params",
          "type": "GeneratePixPayloadParams"
        }
      ],
      "returns": "string?",
      "cases": [
        {
          "id": "pixPayload.generate#[{\"key\":\"11257245286\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "11257245286",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the key is invalid"
        },
        {
          "id": "pixPayload.generate#[{\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when neither key nor url is given"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when both key and url are given"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "url": "",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when url is an empty string"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"fulano@example.com\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\",\"amount\":0.001}]",
          "args": [
            {
              "key": "fulano@example.com",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia",
              "amount": 0.001
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the amount rounds to 0.00"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\",\"amount\":10}]",
          "args": [
            {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia",
              "amount": 10
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when a dynamic payload (url) also carries an amount or a txid"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\",\"txid\":\"ABC123\"}]",
          "args": [
            {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia",
              "txid": "ABC123"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when a dynamic payload (url) also carries an amount or a txid"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"   \",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "   ",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the merchant name is missing or empty after folding"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"💸\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "💸",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the merchant name is missing or empty after folding"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\" \"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": " "
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the merchant city is missing or empty after folding"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"123e4567-e12b-12d1-a456-426655440000\",\"merchantName\":\"Fulano de Tal\",\"merchantCity\":\"BRASILIA\"}]",
          "args": [
            {
              "key": "123e4567-e12b-12d1-a456-426655440000",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA"
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3D"
          },
          "note": "JavaScript's own test: should generate a valid payload matching the static example of the Bacen manual"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"a&b@example.com\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "a&b@example.com",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "from the maintainer briefing, #593: an e-mail key with & is not a key (DICT API 2.12.1)"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"a{b}@example.com\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasilia\"}]",
          "args": [
            {
              "key": "a{b}@example.com",
              "merchantName": "Fulano",
              "merchantCity": "Brasilia"
            }
          ],
          "expect": {
            "returns": "00020126380014br.gov.bcb.pix0116a{b}@example.com5204000053039865802BR5906Fulano6008Brasilia62070503***63049AB3"
          },
          "note": "changed in 2.5.0 (#593): an e-mail key only the DICT pattern accepts"
        },
        {
          "id": "pixPayload.generate#generated-is-valid",
          "args": [
            {
              "key": "12345678909",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "amount": 10.5,
              "txid": "PEDIDO42"
            }
          ],
          "expect": {
            "satisfies": "pixPayload.isValid"
          },
          "note": "every generated payload must pass the lib's own validator"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"123.456.789-09\",\"merchantName\":\"Fulano de Tal\",\"merchantCity\":\"Brasília\",\"amount\":123.45}]",
          "args": [
            {
              "key": "123.456.789-09",
              "merchantName": "Fulano de Tal",
              "merchantCity": "Brasília",
              "amount": 123.45
            }
          ],
          "expect": {
            "returns": "00020126330014br.gov.bcb.pix0111123456789095204000053039865406123.455802BR5913Fulano de Tal6008Brasilia62070503***630479EE"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano de Tal\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano de Tal",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": "00020101021226480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008Brasilia62070503***6304FC66"
          },
          "note": "JavaScript docs example"
        },
        {
          "id": "pixPayload.generate#[{\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "merchantName": "Fulano",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript docs example (neither key nor url)"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"123.456.789-09\",\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "key": "123.456.789-09",
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript docs example (both key and url)"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"João da Silva Sauro Júnior Segundo\",\"merchantCity\":\"São José dos Campos do Sul\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "João da Silva Sauro Júnior Segundo",
              "merchantCity": "São José dos Campos do Sul"
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d5204000053039865802BR5925Joao da Silva Sauro Junio6015Sao Jose dos Ca62070503***63047E1C"
          },
          "note": "JavaScript's own test: truncating the merchant name to 25 characters and the city to 15, after folding the accents"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Ação Ñandú\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Ação Ñandú",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d5204000053039865802BR5910Acao Nandu6008Brasilia62070503***630495AE"
          },
          "note": "JavaScript's own test: folding accents out of the merchant name and city"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":0.005}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 0.005
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the amount rounds to 0.00"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":123.456}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 123.456
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the amount has more than two decimal places, since writing it would change the sum asked for"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":0}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 0
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the amount is not a positive finite number"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":-5}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": -5
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the amount is not a positive finite number"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":10.5,\"txid\":\"PEDIDO42\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 10.5,
              "txid": "PEDIDO42"
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d520400005303986540510.505802BR5906Fulano6008Brasilia62120508PEDIDO42630418B1"
          },
          "note": "JavaScript's own test: with the txid when it is given"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"txid\":\"PED-42\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "txid": "PED-42"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the txid is not alphanumeric or is too long"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"txid\":\"AAAAAAAAAAAAAAAAAAAAAAAAAA\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "txid": "AAAAAAAAAAAAAAAAAAAAAAAAAA"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the txid is not alphanumeric or is too long"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"txid\":\"AAAAAAAAAAAAAAAAAAAAAAAAA\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "txid": "AAAAAAAAAAAAAAAAAAAAAAAAA"
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d5204000053039865802BR5906Fulano6008Brasilia62290525AAAAAAAAAAAAAAAAAAAAAAAAA6304F4F8"
          },
          "note": "a txid of exactly 25 characters is accepted"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"description\":\"Pagamento do pedido\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "description": "Pagamento do pedido"
            }
          ],
          "expect": {
            "returns": "00020126810014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d0219Pagamento do pedido5204000053039865802BR5906Fulano6008Brasilia62070503***6304B302"
          },
          "note": "the description goes in 26-02"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":0.30000000000000004}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 0.30000000000000004
            }
          ],
          "expect": {
            "returns": "00020126580014br.gov.bcb.pix013671c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d52040000530398654040.305802BR5906Fulano6008Brasilia62070503***6304964E"
          },
          "note": "JavaScript's own test: with an amount whose binary representation is not exact, as 0.1 + 0.2 is"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":1}]",
          "args": [
            {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 1
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when a dynamic payload (url) also carries an amount or a txid"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"https://pix.example.com/qr/v2/1234\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "url": "https://pix.example.com/qr/v2/1234",
              "merchantName": "Fulano",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when url is not a PSP location: scheme"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "url": "pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
              "merchantName": "Fulano",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": "00020101021226990014br.gov.bcb.pix2577pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5204000053039865802BR5906Fulano6008Brasilia62070503***63041C95"
          },
          "note": "JavaScript's own test: accepting a url of exactly 77 characters"
        },
        {
          "id": "pixPayload.generate#[{\"url\":\"pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\"}]",
          "args": [
            {
              "url": "pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
              "merchantName": "Fulano",
              "merchantCity": "Brasília"
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when url is longer than 77 characters"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"\"}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": ""
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the merchant city is missing or empty after folding"
        },
        {
          "id": "pixPayload.generate#[{\"key\":\"71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d\",\"merchantName\":\"Fulano\",\"merchantCity\":\"Brasília\",\"amount\":99999999999.99}]",
          "args": [
            {
              "key": "71c7d9be-4b85-4e43-9f1c-1f3b8b4e9a2d",
              "merchantName": "Fulano",
              "merchantCity": "Brasília",
              "amount": 99999999999.99
            }
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when the amount does not fit in 13 characters"
        }
      ]
    },
    {
      "id": "pixPayload.getInfo",
      "level": "extended",
      "summary": "Splits a Pix BR Code payload, the string behind a Pix QR Code and behind \"Pix copia e cola\", into its fields.",
      "description": "Parses a Pix BR Code payload into its fields. Returns `null` exactly when `pixPayload.isValid` returns `false`, never a partial result.\n\n- Fields: merchant name and city, point of initiation (dynamic when there is a PSP location or object `01` is `12`, static otherwise, so a key payload with `01` = `12` is dynamic) and either the key (static) or the URL (dynamic).\n- Amount (a number, so `98.` reads as 98), txid, description (26-02) and the withdrawal facilitator of a Pix Saque (`fss`, the 8-digit ISPB in 26-03) are present only when the payload carries them. The `***` txid marker means no txid.\n- With a PSP location, the function leaves out the amount and the txid, as §2.7 of the manual requires (\"Se preenchidos, seu conteúdo deve ser ignorado\").\n- Every rule of `pixPayload.isValid` applies, so a payload without object `62`, with a static txid outside 1 to 25 letters and digits, or with a key not in its DICT form returns `null`. 2.4.0 parsed those payloads.\n- A repeated object ID, a CRC that is not the last top-level object and every other rule of `pixPayload.isValid` return `null`, so the payload is never partly read. A value that is not a string returns `null`.\n- A composite Pix Automático QR Code that also carries a key or a payment location is read as an ordinary payload, its recurrence location dropped. Whitespace around the payload is ignored.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "PixPayloadInfo?",
      "cases": [
        {
          "id": "pixPayload.getInfo#bacen-static-example",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3D"
          ],
          "expect": {
            "returns": {
              "key": "123e4567-e12b-12d1-a456-426655440000",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static"
            }
          }
        },
        {
          "id": "pixPayload.getInfo#with-amount-and-txid",
          "args": [
            "00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6019Presidente Prudente62180514Um-Id-Qualquer6304D475"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#593): the city has 19 characters (EMV 60: up to 15) and the txid Um-Id-Qualquer has '-' (§2.6.2). 2.4.0 parsed it. JavaScript's own test: when the payloads are taken as published"
        },
        {
          "id": "pixPayload.getInfo#wrong-crc",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3E"
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "pixPayload.getInfo#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": null
          }
        },
        {
          "id": "pixPayload.getInfo#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it is an empty or blank string"
        },
        {
          "id": "pixPayload.getInfo#[\"pix copia e cola\"]",
          "args": [
            "pix copia e cola"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when it is free text"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226500014br.gov.bcb.pix0107a@b.com2517pix.example.com/x5204000053039865802BR5901A6001B62070503***63049A4B\"]",
          "args": [
            "00020101021226500014br.gov.bcb.pix0107a@b.com2517pix.example.com/x5204000053039865802BR5901A6001B62070503***63049A4B"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the merchant account information carries both a key and a url"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226470014br.gov.bcb.pix2525https://pix.example.com/x5204000053039865802BR5901A6001B62070503***6304F843\"]",
          "args": [
            "00020101021226470014br.gov.bcb.pix2525https://pix.example.com/x5204000053039865802BR5901A6001B62070503***6304F843"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the url is not a PSP location (scheme, whitespace, host without a dot)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226390014br.gov.bcb.pix2517pix example.com/x5204000053039865802BR5901A6001B62070503***6304C8E4\"]",
          "args": [
            "00020101021226390014br.gov.bcb.pix2517pix example.com/x5204000053039865802BR5901A6001B62070503***6304C8E4"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the url is not a PSP location (scheme, whitespace, host without a dot)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226330014br.gov.bcb.pix2511localhost/x5204000053039865802BR5901A6001B62070503***630494D9\"]",
          "args": [
            "00020101021226330014br.gov.bcb.pix2511localhost/x5204000053039865802BR5901A6001B62070503***630494D9"
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: should return null when the url is not a PSP location (scheme, whitespace, host without a dot)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654041.005802BR5901A6001B62100506ABC1236304C7F9\"]",
          "args": [
            "00020101021226480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654041.005802BR5901A6001B62100506ABC1236304C7F9"
          ],
          "expect": {
            "returns": {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "A",
              "merchantCity": "B",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a static payload should ignore the transaction amount and the txid of a dynamic payload, which belong to the PSP location"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CAC\"]",
          "args": [
            "00020101021226330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CAC"
          ],
          "expect": {
            "returns": {
              "key": "12345678909",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a static payload marked single use by the point of initiation method 12, which the manual allows on any BR Code"
        },
        {
          "id": "pixPayload.getInfo#[\"00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062190515RP12345678-201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304AD38\"]",
          "args": [
            "00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062190515RP12345678-201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304AD38"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#593): the txid RP12345678-2019 has a '-', outside the letters and digits of §2.6.2 of the Pix manual; a static payload keeps it excluded. 2.4.0 parsed it. JavaScript's own test: when the payloads are taken as published"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630464E4\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630464E4"
          ],
          "expect": {
            "returns": {
              "url": "pix.example.com/8b3da2f39a4140d1a91abd93113bd441",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a dynamic payload from the dynamic QR Code example in the Bacen 'Manual de Padrões para Iniciação do Pix'"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac1200026304FB42\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac1200026304FB42"
          ],
          "expect": {
            "returns": {
              "url": "pix.example.com/8b3da2f39a4140d1a91abd93113bd441",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a dynamic payload picking the Pix arrangement out of the composite QR Code example in the Bacen manual"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041420\"]",
          "args": [
            "00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041420"
          ],
          "expect": {
            "returns": {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a dynamic payload when it carries no point of initiation method at all, which the manual marks optional"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304F299\"]",
          "args": [
            "00020101021126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304F299"
          ],
          "expect": {
            "returns": {
              "url": "pix.example.com/qr/v2/1234",
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic"
            }
          },
          "note": "JavaScript's own test: should parse a dynamic payload when the point of initiation method is 11, since the PSP location is what makes it dynamic"
        },
        {
          "id": "pixPayload.getInfo#[\"00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062180514RP12345678201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304126F\"]",
          "args": [
            "00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062180514RP12345678201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304126F"
          ],
          "expect": {
            "returns": {
              "merchantName": "NOME DO RECEBEDOR",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "123e4567-e12b-12d1-a456-426655440000",
              "amount": 123.45,
              "txid": "RP123456782019"
            }
          },
          "note": "JavaScript's own test: should parse the multi-arrangement payload from the 'Manual do BR Code' §2.2, with a txid the Pix manual allows"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6010Presidente62160512UmIdQualquer63049404\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6010Presidente62160512UmIdQualquer63049404"
          ],
          "expect": {
            "returns": {
              "merchantName": "Alexandre Lima",
              "merchantCity": "Presidente",
              "pointOfInitiation": "static",
              "key": "bee05743-4291-4f3c-9259-595df1307ba1",
              "amount": 10,
              "txid": "UmIdQualquer"
            }
          },
          "note": "JavaScript's own test: should parse a community payload with an amount and a txid, brought within the Pix manual"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000030812345678520400005303986540550.005802BR5913Fulano de Tal6008BRASILIA62070503***630419A4\"]",
          "args": [
            "00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000030812345678520400005303986540550.005802BR5913Fulano de Tal6008BRASILIA62070503***630419A4"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "123e4567-e12b-12d1-a456-426655440000",
              "withdrawalFacilitator": "12345678",
              "amount": 50
            }
          },
          "note": "a Pix Saque BR Code: withdrawalFacilitator reads the fss (26-03)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***6304A029\"]",
          "args": [
            "00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***6304A029"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic",
              "url": "pix.example.com/qr/v2/1234"
            }
          },
          "note": "a dynamic payload with a zero amount: the amount is left out next to a PSP location"
        },
        {
          "id": "pixPayload.getInfo#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-20196304F315\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-20196304F315"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "dynamic",
              "url": "pix.example.com/8b3da2f39a4140d1a91abd93113bd441"
            }
          },
          "note": "from the maintainer briefing, #593: a dynamic BR Code with 62-05 filled is valid and its txid is left out (§2.7)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126560014br.gov.bcb.pix0111123456789090219Pagamento do pedido5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041B76\"]",
          "args": [
            "00020126560014br.gov.bcb.pix0111123456789090219Pagamento do pedido5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041B76"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "12345678909",
              "description": "Pagamento do pedido"
            }
          },
          "note": "the description (26-02) is present when the payload carries it"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540398.5802BR5913Fulano de Tal6008BRASILIA62070503***6304E1E3\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540398.5802BR5913Fulano de Tal6008BRASILIA62070503***6304E1E3"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "123e4567-e12b-12d1-a456-426655440000",
              "amount": 98
            }
          },
          "note": "\"98.\" reads as 98 (EMV allows the decimal mark with no decimals)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509abcXYZ01963047D9D\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509abcXYZ01963047D9D"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tal",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "12345678909",
              "txid": "abcXYZ019"
            }
          },
          "note": "a static txid of letters and digits is read"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA6304740C\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA6304740C"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#593): the manual has 62-05 \"sempre presente em um BR Code\" (§2.6, footnote 21), so a payload without object 62 is invalid. 2.4.0 parsed it"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-201963049060\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-201963049060"
          ],
          "expect": {
            "returns": null
          },
          "note": "from the maintainer briefing, #593: in a static payload the '-' of RP12345678-2019 stays excluded"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126360014br.gov.bcb.pix0114123.456.789-095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304B354\"]",
          "args": [
            "00020126360014br.gov.bcb.pix0114123.456.789-095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304B354"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#593): the key must be in its DICT form (§2.5.1)"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6019Presidente Prudente62070503***63040E59\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6019Presidente Prudente62070503***63040E59"
          ],
          "expect": {
            "returns": null
          },
          "note": "changed in 2.5.0 (#593): EMV 60 allows up to 15 characters"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5903abc63045B77\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5903abc63045B77"
          ],
          "expect": {
            "returns": null
          },
          "note": "a repeated object ID gives null, with a CRC that matches"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126360014br.gov.bcb.pix0114+55119876543215204000053039865802BR5906Fulano6008BRASILIA62130509A6304872F\"]",
          "args": [
            "00020126360014br.gov.bcb.pix0114+55119876543215204000053039865802BR5906Fulano6008BRASILIA62130509A6304872F"
          ],
          "expect": {
            "returns": null
          },
          "note": "a CRC that only looks like the last object gives null"
        },
        {
          "id": "pixPayload.getInfo#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tãl6008BRASILIA62070503***6304CC2B\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tãl6008BRASILIA62070503***6304CC2B"
          ],
          "expect": {
            "returns": {
              "merchantName": "Fulano de Tãl",
              "merchantCity": "BRASILIA",
              "pointOfInitiation": "static",
              "key": "123e4567-e12b-12d1-a456-426655440000"
            }
          },
          "note": "the name is read as written, accents included"
        },
        {
          "id": "pixPayload.getInfo#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": null
          },
          "note": "JavaScript's own test: when it is null"
        }
      ]
    },
    {
      "id": "pixPayload.isValid",
      "level": "extended",
      "summary": "Validates a Pix BR Code payload, the string behind a Pix QR Code and behind \"Pix copia e cola\".",
      "description": "Validates a Pix BR Code payload against the Manual de Padrões para Iniciação do Pix v2.10.0 and, where the manual is silent, the EMV QRCPS-MPM it builds on. The function checks the form of the key, not whether the key is registered in the DICT.\n\n- Structure: well-formed TLV with every length from `01` to `99`, the payload format indicator `000201` as the first object, and the CRC-16 (`63`) as the last top-level object, whole, matching the payload. Eight trailing characters that only look like `6304` and a checksum (inside another object, for example) do not count as the CRC. A CRC in lowercase hexadecimal is accepted, as in 2.4.0 (no official source fixes the case).\n- An object ID may not repeat at the same level (EMV gives each object one ID per level), whatever the values are, even with a CRC that matches. Until 2.4.0 the last repeated ID won. Only crafted payloads repeat an ID.\n- Mandatory objects: merchant category code (`52`) of 4 digits, currency (`53`) `986`, country (`58`) `BR` in uppercase, merchant name (`59`) of at most 25 characters and merchant city (`60`) of at most 15. Only the length is checked: neither Pix manual restricts the characters of the name and the city (EMV types them as `ans`), so a name with accents is accepted, though `pixPayload.generate` folds both to printable ASCII.\n- The first Merchant Account Information template (IDs 26 to 51) that carries the `br.gov.bcb.pix` GUI (case-insensitive) is the one checked, and a template without the GUI is skipped. It holds exactly one of: a Pix key written in its DICT form, as `pixKey.getInfo` returns it (no mask, lowercase email or UUID, `+55` phone), optionally with the 8-digit ISPB of a Pix Saque facilitator (`fss`, 26-03); or a PSP location (26-25), host and path of at most 77 characters, never next to a `fss`. The host has dot-separated labels of letters, digits and hyphens with at least one dot, and the path takes only URL path characters (no scheme, port, query string or whitespace).\n- Object `01` is optional. When present, it must be `11` or `12`.\n- The amount (`54`) is digits with an optional `.` decimal mark (`98.73`, `98` and `98.` are accepted), at most 2 decimals and 13 characters. Zero is accepted only in a Pix Saque (with a `fss`) or next to a PSP location; a payload with a key alone needs an amount greater than zero.\n- The Additional Data Field Template (`62`) with the txid (62-05) is mandatory (\"sempre presente em um BR Code\", §2.6). The txid is `***` (no txid) or 1 to 25 letters and digits (§2.6.2). So in a static payload the `-` of the Manual do BR Code example `RP12345678-2019` is excluded.\n- Next to a PSP location, only the presence of 62-05 is checked. §2.7 says a filled txid or amount in a dynamic BR Code must be ignored, so a dynamic payload with a filled 62-05 stays valid.\n- Unreserved templates (IDs 80 to 99) are ignored. A composite Pix Automático QR Code that also carries a key or a payment location is read as an ordinary payload; one that carries only the recurrence, with no key or payment location, is invalid.\n- 2.4.0 checked mostly the structure. It accepted a payload without `62`, a txid with `-`, `_` or spaces or over 25 characters, a masked or uppercase key, a phone key without `+55`, a name or city over the limits, a lowercase country code, a merchant category code that is not 4 digits and an object of length `00`. It rejected an amount with a `.` and no decimals (`98.`).\n- A value that is not a string is invalid. Whitespace around the payload is ignored.",
      "params": [
        {
          "name": "value",
          "type": "string"
        }
      ],
      "returns": "boolean",
      "cases": [
        {
          "id": "pixPayload.isValid#bacen-static-example",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3D"
          ],
          "expect": {
            "returns": true
          }
        },
        {
          "id": "pixPayload.isValid#with-amount-and-txid",
          "args": [
            "00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6019Presidente Prudente62180514Um-Id-Qualquer6304D475"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the city has 19 characters (EMV 60: up to 15) and the txid Um-Id-Qualquer has '-' (§2.6.2). 2.4.0 returned true. JavaScript's own test: when the payloads are taken as published"
        },
        {
          "id": "pixPayload.isValid#wrong-crc",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3E"
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "pixPayload.isValid#empty",
          "args": [
            ""
          ],
          "expect": {
            "returns": false
          }
        },
        {
          "id": "pixPayload.isValid#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630464E4\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630464E4"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the dynamic QR Code example in the Bacen 'Manual de Padrões para Iniciação do Pix'"
        },
        {
          "id": "pixPayload.isValid#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac1200026304FB42\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac1200026304FB42"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for the composite QR Code example in the Bacen 'Manual de Padrões para Iniciação do Pix'"
        },
        {
          "id": "pixPayload.isValid#[\"00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062190515RP12345678-201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304AD38\"]",
          "args": [
            "00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062190515RP12345678-201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304AD38"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the txid RP12345678-2019 has a '-', outside the letters and digits of §2.6.2 of the Pix manual; a static payload keeps it excluded. 2.4.0 returned true. JavaScript's own test: when the payloads are taken as published"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA6304740C\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA6304740C"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the manual has 62-05 \"sempre presente em um BR Code\" (§2.6, footnote 21), so a payload without object 62 is invalid. 2.4.0 returned true"
        },
        {
          "id": "pixPayload.isValid#[\"00020101021226330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CAC\"]",
          "args": [
            "00020101021226330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CAC"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when a key payload marks itself single use with the point of initiation method 12"
        },
        {
          "id": "pixPayload.isValid#[\"00020101021126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304F299\"]",
          "args": [
            "00020101021126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304F299"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when a url payload carries the point of initiation method 11, which the manual leaves optional"
        },
        {
          "id": "pixPayload.isValid#[\"00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041420\"]",
          "args": [
            "00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/12345204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041420"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true when a url payload carries no point of initiation method at all"
        },
        {
          "id": "pixPayload.isValid#[\"00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000003081234567852040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***63043A07\"]",
          "args": [
            "00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000003081234567852040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***63043A07"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: should return true for a Pix Saque BR Code, whose fss (26-03) goes with a transaction amount of zero"
        },
        {
          "id": "pixPayload.isValid#[\"   \"]",
          "args": [
            "   "
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is an empty or blank string"
        },
        {
          "id": "pixPayload.isValid#[\"00020126990014br.gov.bcb.pix6304BEFF\"]",
          "args": [
            "00020126990014br.gov.bcb.pix6304BEFF"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the TLV structure is malformed"
        },
        {
          "id": "pixPayload.isValid#[\"000X016304EAB2\"]",
          "args": [
            "000X016304EAB2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the TLV structure is malformed"
        },
        {
          "id": "pixPayload.isValid#[\"00020226580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304BAA3\"]",
          "args": [
            "00020226580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304BAA3"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the payload format indicator is not 01"
        },
        {
          "id": "pixPayload.isValid#[\"00020101021326580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63047DC6\"]",
          "args": [
            "00020101021326580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63047DC6"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the point of initiation method is neither 11 nor 12"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***63042451\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***63042451"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when a key payload states a transaction amount of zero without the fss of a Pix Saque"
        },
        {
          "id": "pixPayload.isValid#[\"00020126690014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400000307123456752040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***630450C2\"]",
          "args": [
            "00020126690014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400000307123456752040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***630450C2"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the fss of a Pix Saque is not the 8 digits of an ISPB"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053038405802BR5913Fulano de Tal6008BRASILIA62070503***63040C88\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053038405802BR5913Fulano de Tal6008BRASILIA62070503***63040C88"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the currency is not 986"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802AR5913Fulano de Tal6008BRASILIA62070503***6304F417\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802AR5913Fulano de Tal6008BRASILIA62070503***6304F417"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the country code is not BR"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630405E3\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000053039865802BR5913Fulano de Tal6008BRASILIA62070503***630405E3"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the merchant category code is missing"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR6008BRASILIA62070503***630452B8\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR6008BRASILIA62070503***630452B8"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the merchant name is missing"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal62070503***63047718\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal62070503***63047718"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the merchant city is missing"
        },
        {
          "id": "pixPayload.isValid#[\"00020126560012br.com.outro0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63045803\"]",
          "args": [
            "00020126560012br.com.outro0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63045803"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the GUI is not br.gov.bcb.pix"
        },
        {
          "id": "pixPayload.isValid#[\"00020126180014br.gov.bcb.pix5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304A335\"]",
          "args": [
            "00020126180014br.gov.bcb.pix5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304A335"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the merchant account information holds neither a key nor a URL"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654061R3.455802BR5913Fulano de Tal6008BRASILIA62070503***63049FEF\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654061R3.455802BR5913Fulano de Tal6008BRASILIA62070503***63049FEF"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when the amount is not a number"
        },
        {
          "id": "pixPayload.isValid#[\"10491443385511900000200000000141325230000093423\"]",
          "args": [
            "10491443385511900000200000000141325230000093423"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is a boleto or free text"
        },
        {
          "id": "pixPayload.isValid#[\"pix copia e cola\"]",
          "args": [
            "pix copia e cola"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: should return false when it is a boleto or free text"
        },
        {
          "id": "pixPayload.isValid#[\"00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062180514RP12345678201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304126F\"]",
          "args": [
            "00020104141234567890123426580014BR.GOV.BCB.PIX0136123e4567-e12b-12d1-a456-42665544000027300012BR.COM.OUTRO011001234567895204000053039865406123.455802BR5917NOME DO RECEBEDOR6008BRASILIA61087007490062180514RP12345678201980390012BR.COM.OUTRO01190123.ABCD.3456.WXYZ6304126F"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for the multi-arrangement payload from the 'Manual do BR Code' §2.2, with a txid the Pix manual allows (RP123456782019)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6010Presidente62160512UmIdQualquer63049404\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136bee05743-4291-4f3c-9259-595df1307ba1520400005303986540510.005802BR5914Alexandre Lima6010Presidente62160512UmIdQualquer63049404"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for a widely published community payload with an amount and a txid, brought within the Pix manual"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865406100.505802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac12000263042875\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865406100.505802BR5913Fulano de Tal6008BRASILIA62070503***80740014br.gov.bcb.pix2552pix.example.com/rec/2353c790eefb11eaadc10242ac12000263042875"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for the composite QR Code example of §2.8.2, a key with an amount and a recurrence location"
        },
        {
          "id": "pixPayload.isValid#[\"00020126380014br.gov.bcb.pix0116a{b}@example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CF0\"]",
          "args": [
            "00020126380014br.gov.bcb.pix0116a{b}@example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63043CF0"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for a key in each DICT form (an e-mail key only the DICT pattern accepts)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126360014br.gov.bcb.pix011412ABC34501DE355204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63047359\"]",
          "args": [
            "00020126360014br.gov.bcb.pix011412ABC34501DE355204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63047359"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for a key in each DICT form"
        },
        {
          "id": "pixPayload.isValid#[\"00020126360014br.gov.bcb.pix0114+55619123456785204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63040284\"]",
          "args": [
            "00020126360014br.gov.bcb.pix0114+55619123456785204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63040284"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for a key in each DICT form"
        },
        {
          "id": "pixPayload.isValid#[\"00020126360014br.gov.bcb.pix0114123.456.789-095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304B354\"]",
          "args": [
            "00020126360014br.gov.bcb.pix0114123.456.789-095204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304B354"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the key must be in its DICT form (§2.5.1). 2.4.0 returned true. JavaScript's own test: when the key is not written in the DICT form"
        },
        {
          "id": "pixPayload.isValid#[\"00020126400014br.gov.bcb.pix0118Fulano@Example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63049F84\"]",
          "args": [
            "00020126400014br.gov.bcb.pix0118Fulano@Example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63049F84"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the key must be in its DICT form (§2.5.1). JavaScript's own test: when the key is not written in the DICT form"
        },
        {
          "id": "pixPayload.isValid#[\"00020126370014br.gov.bcb.pix0115a&b@example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304E129\"]",
          "args": [
            "00020126370014br.gov.bcb.pix0115a&b@example.com5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304E129"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #593: an e-mail key with & is not a key (DICT API 2.12.1)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041d3d\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041d3d"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the CRC is written in lowercase (kept from 2.4.0)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000030812345678520400005303986540550.005802BR5913Fulano de Tal6008BRASILIA62070503***630419A4\"]",
          "args": [
            "00020126700014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000030812345678520400005303986540550.005802BR5913Fulano de Tal6008BRASILIA62070503***630419A4"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: for a Pix Saque BR Code, whose fss (26-03) goes with the amount of the withdrawal"
        },
        {
          "id": "pixPayload.isValid#[\"00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***6304A029\"]",
          "args": [
            "00020126480014br.gov.bcb.pix2526pix.example.com/qr/v2/123452040000530398654040.005802BR5913Fulano de Tal6008BRASILIA62070503***6304A029"
          ],
          "expect": {
            "returns": true
          },
          "note": "from the maintainer briefing, #593: zero is accepted next to a PSP location. JavaScript's own test: for a dynamic payload with a transaction amount of zero, which the payer ignores"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540398.5802BR5913Fulano de Tal6008BRASILIA62070503***6304E1E3\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540398.5802BR5913Fulano de Tal6008BRASILIA62070503***6304E1E3"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the amount carries the decimal mark with no decimals, as the EMV examples allow"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540105802BR5913Fulano de Tal6008BRASILIA62070503***63049169\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540105802BR5913Fulano de Tal6008BRASILIA62070503***63049169"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #593: a payload with a key alone cannot state zero. JavaScript's own test: when a key payload states a transaction amount of zero"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540698.7355802BR5913Fulano de Tal6008BRASILIA62070503***63047FD6\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986540698.7355802BR5913Fulano de Tal6008BRASILIA62070503***63047FD6"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the amount is not digits with at most one decimal mark and two decimals"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654139999999999.995802BR5913Fulano de Tal6008BRASILIA62070503***6304603E\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-42665544000052040000530398654139999999999.995802BR5913Fulano de Tal6008BRASILIA62070503***6304603E"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the amount is longer than 13 characters (13 is the limit)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986541499999999999.995802BR5913Fulano de Tal6008BRASILIA62070503***630498EF\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520400005303986541499999999999.995802BR5913Fulano de Tal6008BRASILIA62070503***630498EF"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the amount is longer than 13 characters"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070103***630476F6\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62070103***630476F6"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): 62 without 62-05. 2.4.0 returned true. JavaScript's own test: when the additional data template carries no txid (62-05)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62290525AAAAAAAAAAAAAAAAAAAAAAAAA63048097\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62290525AAAAAAAAAAAAAAAAAAAAAAAAA63048097"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the txid is neither *** nor 1 to 25 letters and digits (§2.6.2): 25 letters are accepted"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62300526AAAAAAAAAAAAAAAAAAAAAAAAAA6304E639\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62300526AAAAAAAAAAAAAAAAAAAAAAAAAA6304E639"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the txid is neither *** nor 1 to 25 letters and digits (§2.6.2)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-201963049060\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-201963049060"
          ],
          "expect": {
            "returns": false
          },
          "note": "from the maintainer briefing, #593: in a static payload the '-' of RP12345678-2019 stays excluded (§2.6.2). JavaScript's own test: when the txid is neither *** nor 1 to 25 letters and digits"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509pedido_426304FF3C\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509pedido_426304FF3C"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the txid is neither *** nor 1 to 25 letters and digits (§2.6.2)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509abcXYZ01963047D9D\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6008BRASILIA62130509abcXYZ01963047D9D"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the txid is neither *** nor 1 to 25 letters and digits (§2.6.2): lower and upper case letters and digits are accepted"
        },
        {
          "id": "pixPayload.isValid#[\"00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-20196304F315\"]",
          "args": [
            "00020101021226700014br.gov.bcb.pix2548pix.example.com/8b3da2f39a4140d1a91abd93113bd4415204000053039865802BR5913Fulano de Tal6008BRASILIA62190515RP12345678-20196304F315"
          ],
          "expect": {
            "returns": true
          },
          "note": "from the maintainer briefing, #593: a dynamic BR Code with 62-05 filled stays valid (§2.7: \"Se preenchidos, seu conteúdo deve ser ignorado\"). JavaScript's own test: should accept a payload with a PSP location whose 62-05 is filled"
        },
        {
          "id": "pixPayload.isValid#[\"00020126990014br.gov.bcb.pix2577pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304C335\"]",
          "args": [
            "00020126990014br.gov.bcb.pix2577pix.example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304C335"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the PSP location is longer than 77 characters (§2.5.2): 77 is the limit"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5926AAAAAAAAAAAAAAAAAAAAAAAAAA6008BRASILIA62070503***63042185\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5926AAAAAAAAAAAAAAAAAAAAAAAAAA6008BRASILIA62070503***63042185"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): EMV 59 allows up to 25 characters. JavaScript's own test: when the merchant name is longer than 25 characters"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6015Presidente Prud62070503***6304259D\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6015Presidente Prud62070503***6304259D"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the merchant city is longer than 15 characters: 15 is the limit"
        },
        {
          "id": "pixPayload.isValid#[\"00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6019Presidente Prudente62070503***63040E59\"]",
          "args": [
            "00020126330014br.gov.bcb.pix0111123456789095204000053039865802BR5913Fulano de Tal6019Presidente Prudente62070503***63040E59"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): EMV 60 allows up to 15 characters. 2.4.0 returned true. JavaScript's own test: when the merchant city is longer than 15 characters"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802br5913Fulano de Tal6008BRASILIA62070503***63047792\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802br5913Fulano de Tal6008BRASILIA62070503***63047792"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): the ISO 3166-1 code is the uppercase BR. 2.4.0 returned true. JavaScript's own test: when the country code is not the uppercase BR of ISO 3166-1"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***61006304A8F7\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***61006304A8F7"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): EMV lengths go from 01 to 99. 2.4.0 returned true. JavaScript's own test: when an object declares the length 00"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***000202630405AB\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***000202630405AB"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the payload format indicator is repeated later with another value"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520358153039865802BR5913Fulano de Tal6008BRASILIA62070503***630430A6\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-426655440000520358153039865802BR5913Fulano de Tal6008BRASILIA62070503***630430A6"
          ],
          "expect": {
            "returns": false
          },
          "note": "changed in 2.5.0 (#593): EMV 52 is 4 digits. 2.4.0 returned true. JavaScript's own test: when the merchant category code is not 4 digits"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5903abc63045B77\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5903abc63045B77"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when an object ID appears twice, even with a CRC that matches (new in 2.5.0, #615)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5913Fulano de Tal6304B1C1\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***5913Fulano de Tal6304B1C1"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when an object ID appears twice, even with a CRC that matches (new in 2.5.0, #615)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304AAAA63047C97\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***6304AAAA63047C97"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when an object ID appears twice, even with a CRC that matches (new in 2.5.0, #615)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126360014br.gov.bcb.pix0114+55119876543215204000053039865802BR5906Fulano6008BRASILIA62130509A6304872F\"]",
          "args": [
            "00020126360014br.gov.bcb.pix0114+55119876543215204000053039865802BR5906Fulano6008BRASILIA62130509A6304872F"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the last 8 characters only look like a CRC object inside another object (new in 2.5.0, #615)"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***"
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when the payload does not end with the CRC object"
        },
        {
          "id": "pixPayload.isValid#[\"00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tãl6008BRASILIA62070503***6304CC2B\"]",
          "args": [
            "00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tãl6008BRASILIA62070503***6304CC2B"
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's docs: the name and the city are only checked for their length, so a name with accents is accepted (the length here counts characters)"
        },
        {
          "id": "pixPayload.isValid#[null]",
          "args": [
            null
          ],
          "expect": {
            "returns": false
          },
          "note": "JavaScript's own test: when it is null"
        },
        {
          "id": "pixPayload.isValid#[\"  00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3D  \"]",
          "args": [
            "  00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-a456-4266554400005204000053039865802BR5913Fulano de Tal6008BRASILIA62070503***63041D3D  "
          ],
          "expect": {
            "returns": true
          },
          "note": "JavaScript's own test: when the payload is surrounded by whitespace"
        }
      ]
    }
  ]
}
