Repository navigation
fix: send consent billing address with snake_case keys - #64
Merged
weiping-awx merged 1 commit intoNov 3, 2026
Merged
Conversation
payWithConsent converted the consent, payment method, card and billing keys to snake_case but left billing.address as camelCase. The iOS SDK decodes the address with AWXAddress decodeFromJSON, which only reads country_code, so the billing country was dropped on iOS. Android accepts both forms, so converting the nested address is safe on both platforms.
weiping-awx
approved these changes
Nov 3, 2026
Contributor
|
Thanks for the fix and the tests. The native mobile SDKs do not use the consent billing address in this flow. The change is still correct, so we will merge it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
payWithConsentconverts the consent,paymentMethod,cardandbillingkeys to snake_case before calling the native module, butbilling.addressis passed through as camelCase (countryCode).On iOS the consent goes through
AWXPaymentConsent.decode(fromJSON:), andAWXAddress decodeFromJSONonly readsjson[@"country_code"](AWXAddress.m), so the billing address country is dropped. On Android,toAddress()already accepts bothcountryCodeandcountry_code, so converting the nested address works on both platforms.Change: also run
transformKeysToSnakeCaseonbilling.addresswhen it is present. Nothing else in the payload changes.Testing:
src/__tests__/payWithConsent.test.ts, which mocks the native module and checks the payload: billing address keys come through as snake_case (this fails onmain, wherecountryCodeis sent), and noaddresskey is added when billing has none.yarn jest,yarn tscandyarn eslintpass locally. I have not run it on a device, only the JS-level tests.