Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addressPostalCode from Billing Address is not saved on Stripe #613

Closed
simona-iuliana opened this issue Sep 27, 2021 · 5 comments · Fixed by #635
Closed

addressPostalCode from Billing Address is not saved on Stripe #613

simona-iuliana opened this issue Sep 27, 2021 · 5 comments · Fixed by #635

Comments

@simona-iuliana
Copy link

simona-iuliana commented Sep 27, 2021

I'm trying to send the postalCode in billingAddress along with country, the country is saved in Stripe, but the postal code isn't.
The weird thing is that this works on ios, but not on android.

Steps to reproduce the behavior:
On the CardField I used postalCodeEnabled={false} and the postal code is on a separate textinput and i send it like that:

const billingDetails: PaymentMethodCreateParams.BillingDetails = { addressCountry: values.countryCode || CountryCode.US, addressPostalCode: values.addressZipCode, };
On IOS works, the postal code is saved in Stripe on that billing address field, but on Android isn't.

  • Device: Android

i'm using "@stripe/stripe-react-native": "0.2.0"

@simona-iuliana simona-iuliana changed the title addressPostalCode from Billing Address is not saved on strapi addressPostalCode from Billing Address is not saved on Stripe Sep 27, 2021
@simona-iuliana
Copy link
Author

I solve this issue with patch-package. In android/src/main/java/com/reactnativestripesdk/Mappers.kt at line 433. The problem was that the postalcode from cardAddres isn't null, is an empty string and that overwrite the postalCode from the billing address.
This is what I did, I check for empty strings too:

cardAddress?.let { ca ->
ca.postalCode?.let {
if (ca.postalCode != "") {
address.setPostalCode(it)
}
}
ca.country?.let {
if (ca.country != "") {
address.setCountry(it)
}
}
}

@ataravati
Copy link

I'm having the same issue. This seems to be a bug.

@ataravati
Copy link

@acomley-stripe It looks like the PR that was merged only fixes this for Android?

@acomley-stripe
Copy link
Contributor

Correct. If this is also an issue on iOS I will re-open and prioritize.

@ataravati
Copy link

@acomley-stripe I'm not sure if it's the same issue, but on iOS if I disable postal code on the CardField, the postal code in billingDetails will be overwritten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants