-
Notifications
You must be signed in to change notification settings - Fork 645
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
Add prefix
to form field value in PhoneNumberController
#9571
Add prefix
to form field value in PhoneNumberController
#9571
Conversation
Diffuse output:
APK
DEX
|
7310d31
to
d02364c
Compare
d02364c
to
8a65403
Compare
@@ -95,7 +95,7 @@ internal class LinkSignupHandlerForNetworking @Inject constructor( | |||
saveAccountToLink.new( | |||
country = phoneController.getCountryCode(), | |||
email = state.validEmail!!, | |||
phoneNumber = phoneController.getE164PhoneNumber(state.validPhone!!), | |||
phoneNumber = state.validPhone!!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that formFieldValue
transmits this, we don't need to convert it manually. This is covered by Maestro tests.
@@ -51,7 +51,7 @@ internal fun billingDetailsParams(): RequestMatcher { | |||
internal fun fullBillingDetailsParams(): RequestMatcher { | |||
return RequestMatchers.composite( | |||
bodyPart(urlEncode("billing_details[name]"), urlEncode(CustomerSheetPage.NAME)), | |||
bodyPart(urlEncode("billing_details[phone]"), CustomerSheetPage.PHONE_NUMBER), | |||
bodyPart(urlEncode("billing_details[phone]"), urlEncode("+1${CustomerSheetPage.PHONE_NUMBER}")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were we sending this to the backend incorrectly!??!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately yeah :(. This has been a fairly long standing issue (since 2022 at least)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this broken in PaymentSheet as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah since we weren't manually converting the text input. InlineLinkSignup
did it properly but not any phone number field outside of it (through billing config, required by LPM)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Nice fix!
Summary
Adds prefix of the selected to the phone number
formFieldValue
inPhoneNumberController
Motivation
formFieldValue
indicates the final value we want to send for a customer's phone number when creating a payment method, signing up forLink
, etc. Unfortunately on Android, we've been sending just the user's filtered text input and did not include the prefix of the selected country. This PR adds the prefix to the form field value in order to ensure the phone is transmitted properly.Testing