{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"scripts","description":"User guides, API reference, and support resources.","siteUrl":"https://docs.ripple.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"scripts","__idx":0},"children":["scripts"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cn-cny-bank-code-dataset","__idx":1},"children":["CN-CNY bank code dataset"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["build_cn_cny_bank_codes.py"]}," builds the China lookup dataset,"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["static/products/payments-direct-2/data-requirements/china-cny-ripple-bank-codes.json"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The CN-CNY corridor was withdrawn from v2026.03, so that dataset is not"," ","currently in the repo and the Bank Codes utility no longer reads it. This"," ","script is kept to regenerate it if the corridor returns."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"python3 scripts/build_cn_cny_bank_codes.py          # dry run, prints counts\npython3 scripts/build_cn_cny_bank_codes.py --write  # write the JSON\npython3 scripts/build_cn_cny_bank_codes.py --check  # verify, write nothing\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Source of truth is the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ripple-bank-codes"]}," repo, read from a sibling checkout."," ","Run this after any CN/CNY change there, otherwise the published lookup drifts"," ","from the master."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--check"]}," re-derives the dataset and compares it to the published JSON, exiting"," ","non-zero if they disagree. It reports the difference per bank code rather than"," ","as a line diff, since a line diff across 3,437 rows buries the change, and it"," ","distinguishes a genuine content difference from a row-order or formatting one."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The CN master carries no Chinese bank names, so the script reconstructs them by"," ","joining the Hanshan and LianLian partner mappings. Its own header documents that"," ","join and the English-name fallback, which should match nothing; the script"," ","prints the fallback count so a regression is visible."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"corridor-data-requirements-pages","__idx":2},"children":["Corridor data requirements pages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generate_corridor_pages.py"]}," builds the six v2026.03 African corridor pages"," ","(GH, NG, RW, UG, ZA, ZM) under"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products/payments-direct-2/@v2026.03/api-docs/integration-resources/emea/"]},"."," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["corridor_page_sources.py"]}," holds the source readers and the Markdoc table"," ","helper."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"python3 scripts/generate_corridor_pages.py            # regenerate all six\npython3 scripts/generate_corridor_pages.py GH ZA      # regenerate some\npython3 scripts/generate_corridor_pages.py --check     # verify, write nothing\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pyyaml"]},". Paths resolve relative to the script, so it works from any"," ","checkout of the RPD2 monorepo; set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RPD2_ROOT"]}," if your checkout lives"," ","elsewhere."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--check"]}," re-derives every page and diffs it against what is on disk, exiting"," ","non-zero if they disagree. Run it after either source system changes to find"," ","out whether the published pages have gone stale."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sources-and-precedence","__idx":3},"children":["Sources and precedence"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Content"},"children":["Content"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Source of truth"},"children":["Source of truth"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Identity requirements"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PII v3 spec (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pii-service"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment-participants.yaml"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Financial instrument requirements"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PII v3 spec"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction requirements, purpose codes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ADR (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data-requirements/adr"]},")"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Deviations between the two are expected, and PII v3 wins for identity and"," ","financial instrument data. The ADR is the PII v2 view: its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Cdtr.*"]}," and"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Dbtr.*"]}," fields are ISO 20022 renderings of data that v3 carries inside the"," ","identity and financialInstrument objects. PII v3 does not use the ISO field"," ","names, so those fields are deliberately absent from the generated pages."," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Purp.Cd"]}," is the only ADR field set on the payment itself, and v3 names it"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["purposeCode"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Nothing is inferred. A constraint absent from both sources is omitted rather"," ","than guessed at, and the table helper refuses to emit a table with no rows, so"," ","a broken lookup fails loudly instead of publishing an empty section."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two tables in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generate_corridor_pages.py"]}," are hand-maintained rather than read"," ","from a source system, each with a comment citing where it came from:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LIVE_PARTNERS"]}," restricts each corridor to the partners that actually serve"," ","it. The ADR also carries files for partners that are not live, and without"," ","this their requirements would leak into the published tables."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUPPORTED_USE_CASES"]}," records the commercially supported use cases. DRE"," ","carries routing rules for all six use cases in every African corridor, but"," ","routing config is not the same as a supported offering. ZA is C2B2C only."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"known-upstream-defect","__idx":4},"children":["Known upstream defect"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In every African corridor the ADR has the description, help text and"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maxLength"]}," attached to the wrong one of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CdtrAgt.FinInstnId.Nm"]}," and"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CdtrAgt.FinInstnId.Othr.Id"]},". The enum values prove the swap: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Othr.Id"]}," carries"," ","codes while ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Nm"]}," carries names. The lengths are wrong too, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Nm"]}," capped at"," ","20 while 17 of its own 47 values run longer, up to 49 characters. Raised with"," ","CPE 2026-09-09. This does not affect the generated pages, which take bank name"," ","and bank code from the PII v3 financial instrument schema, but it will matter to"," ","anything that reads those two ADR fields."]}]},"headings":[{"value":"scripts","id":"scripts","depth":1},{"value":"CN-CNY bank code dataset","id":"cn-cny-bank-code-dataset","depth":2},{"value":"Corridor data requirements pages","id":"corridor-data-requirements-pages","depth":2},{"value":"Sources and precedence","id":"sources-and-precedence","depth":3},{"value":"Known upstream defect","id":"known-upstream-defect","depth":3}],"frontmatter":{"seo":{"title":"scripts"}},"lastModified":"2026-09-23T18:09:45.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/scripts/readme","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}