Add CNY bank-transfer rail (B2B) alongside mobile wallet#554
Add CNY bank-transfer rail (B2B) alongside mobile wallet#554mohamedwane wants to merge 1 commit into
Conversation
CNY currently supports only the MOBILE_MONEY rail (individual beneficiary). Add the BANK_TRANSFER rail so CNY accounts can target a bank account, mirroring the dual-rail COP schema: - CnyAccountInfoBase: bankName is now the only required field beyond accountType; phoneNumber becomes optional (MOBILE_MONEY only) and a new optional accountNumber is added (BANK_TRANSFER only). Per-rail requirements are documented on the schema and enforced at the application layer, same as COP. - CnyAccountInfo: add BANK_TRANSFER to the paymentRails enum. The beneficiary oneOf already supports BUSINESS (BusinessBeneficiary) in addition to INDIVIDUAL, so the business-to-business shape the bank rail requires (legalName + address) needs no further schema change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
|
Greptile SummaryThis PR adds
Confidence Score: 4/5Safe to merge; the schema change is additive and closely mirrors the established COP dual-rail pattern with no breaking API surface changes. The base-schema example now demonstrates only the BANK_TRANSFER case, silently dropping the phoneNumber illustration that MOBILE_MONEY consumers would expect. Everything else — the enum extension, the field constraints, the required-field adjustment — is consistent with CopAccountInfoBase and introduces no structural risk. openapi/components/schemas/common/CnyAccountInfoBase.yaml — the example object warrants a small touch to re-include phoneNumber for completeness.
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/common/CnyAccountInfoBase.yaml | Removes phoneNumber from required, adds optional accountNumber for BANK_TRANSFER rail; example now shows only BANK_TRANSFER fields, losing the MOBILE_MONEY illustration present in the COP counterpart. |
| openapi/components/schemas/common/CnyAccountInfo.yaml | Adds BANK_TRANSFER to the paymentRails enum alongside MOBILE_MONEY; clean, minimal change consistent with CopAccountInfo. |
| openapi.yaml | Bundled artifact reflecting the same base-schema changes; same example gap as the source YAML. |
| mintlify/openapi.yaml | Mintlify-copy of the bundled spec; identical changes to openapi.yaml. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CNY Payout Request] --> B{paymentRails}
B -->|MOBILE_MONEY| C[Required: bankName\nExpected: phoneNumber]
B -->|BANK_TRANSFER| D[Required: bankName\nExpected: accountNumber]
C --> E{beneficiary.type}
D --> F{beneficiary.type}
E -->|INDIVIDUAL| G[IndividualBeneficiary\nname + address]
E -->|BUSINESS| H[BusinessBeneficiary\nlegalName + address]
F -->|INDIVIDUAL| G
F -->|BUSINESS| H
G --> I[Submit Payout]
H --> I
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
openapi/components/schemas/common/CnyAccountInfoBase.yaml:32-35
The updated example only illustrates the `BANK_TRANSFER` rail — `phoneNumber` has been dropped entirely. The `CopAccountInfoBase.yaml` counterpart includes all optional fields in its example so consumers can see every supported field at a glance. Without a `phoneNumber` entry here, a developer targeting the `MOBILE_MONEY` rail has no inline reference for that field in the base schema.
```suggestion
example:
accountType: CNY_ACCOUNT
accountNumber: '1234567890'
phoneNumber: '+1234567890'
bankName: China Construction Bank
```
Reviews (1): Last reviewed commit: "Add CNY bank-transfer rail (B2B) alongsi..." | Re-trigger Greptile
| example: | ||
| accountType: CNY_ACCOUNT | ||
| phoneNumber: '+1234567890' | ||
| bankName: Example Bank | ||
| accountNumber: '1234567890' | ||
| bankName: China Construction Bank |
There was a problem hiding this comment.
The updated example only illustrates the
BANK_TRANSFER rail — phoneNumber has been dropped entirely. The CopAccountInfoBase.yaml counterpart includes all optional fields in its example so consumers can see every supported field at a glance. Without a phoneNumber entry here, a developer targeting the MOBILE_MONEY rail has no inline reference for that field in the base schema.
| example: | |
| accountType: CNY_ACCOUNT | |
| phoneNumber: '+1234567890' | |
| bankName: Example Bank | |
| accountNumber: '1234567890' | |
| bankName: China Construction Bank | |
| example: | |
| accountType: CNY_ACCOUNT | |
| accountNumber: '1234567890' | |
| phoneNumber: '+1234567890' | |
| bankName: China Construction Bank |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/common/CnyAccountInfoBase.yaml
Line: 32-35
Comment:
The updated example only illustrates the `BANK_TRANSFER` rail — `phoneNumber` has been dropped entirely. The `CopAccountInfoBase.yaml` counterpart includes all optional fields in its example so consumers can see every supported field at a glance. Without a `phoneNumber` entry here, a developer targeting the `MOBILE_MONEY` rail has no inline reference for that field in the base schema.
```suggestion
example:
accountType: CNY_ACCOUNT
accountNumber: '1234567890'
phoneNumber: '+1234567890'
bankName: China Construction Bank
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Adds the
BANK_TRANSFERrail to the CNY account schema so CNY payouts can target a bank account (business-to-business), in addition to the existingMOBILE_MONEYwallet rail. Mirrors the dual-railCOPschema pattern.Changes
CnyAccountInfoBase.yaml:bankNameis now the only required field beyondaccountType.phoneNumberbecomes optional (MOBILE_MONEYonly); new optionalaccountNumberadded (BANK_TRANSFERonly). Per-rail requirements documented on the schema and enforced at the application layer, exactly likeCOP.CnyAccountInfo.yaml: addBANK_TRANSFERto thepaymentRailsenum.The
beneficiaryoneOf already supportsBUSINESS(BusinessBeneficiary) alongsideINDIVIDUAL, so the B2B shape the bank rail requires (legalName+address) needs no further schema change. The credit-party identifier for the bank rail is justbank_account_number(confirmed against the live payer requirements).Test plan
npm run build:openapibundles cleanlygrid_apiin webdev, wire the bank rail in sparkcore (rails config, fields provider, account.py, B2B transaction-type resolution), add itests