-
Notifications
You must be signed in to change notification settings - Fork 658
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 Boleto to PaymentSheet. #7282
Conversation
Diffuse output:
APK
DEX
ARSC
|
ddbabc7
to
eee260b
Compare
e01864b
to
546925a
Compare
CHANGELOG.md
Outdated
* [ADDED] PaymentSheet now supports the following payment methods for SetupIntents and PaymentIntents with setup for future usage: | ||
* [7282](https://github.com/stripe/stripe-android/pull/7282) Boleto |
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.
Nit: Should make this a single line if we don’t end up adding the same support for more payment methods in this release.
requestOptions: ApiRequest.Options | ||
) { | ||
(authenticatable.nextActionData as NextActionData.DisplayBoletoDetails).let { detailsData -> | ||
if (detailsData.hostedVoucherUrl == null) { |
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.
Can this even happen?
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.
I copied what Oxxo was doing. In theory it could? In practice probably not.
@@ -84,6 +84,13 @@ internal class WebIntentAuthenticator @Inject constructor( | |||
returnUrl = null | |||
shouldCancelIntentOnUserNavigation = false | |||
} | |||
is StripeIntent.NextActionData.DisplayBoletoDetails -> { | |||
// nextActionData.hostedVoucherUrl will never be null as AuthenticatorRegistry won't direct it here | |||
authUrl = nextActionData.hostedVoucherUrl.takeIf { it!!.isNotEmpty() } |
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.
Do we need this check here?
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.
I just copied Oxxo. 🤷
|
||
@Serializable | ||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) | ||
data class BoletoTaxIdSpec( |
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.
Do we need to do any validation of the input here, or limit it to a certain length?
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.
The backend does validation. Talked over slack, and planning to do the minimum here for now. If it gets traction, we can add client side validation as a future improvement.
requestOptions: ApiRequest.Options | ||
) { | ||
(authenticatable.nextActionData as NextActionData.DisplayBoletoDetails).let { detailsData -> | ||
if (detailsData.hostedVoucherUrl == null) { |
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.
Is there ever a case where hostedVoucherUrl is null? And if it is null, what do we do instead?
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.
We wouldn't choose this authenticator. Likely a server bug that we shouldn't crash from, but an error they'd need to fix.
AFAIK, hostedVoucherUrl
should never be null.
cb6e5b8
to
dadfc85
Compare
Summary
Add boleto, also a bunch of changes to our test harness to be able to E2E test QR code based LPMs in PS.
Motivation
LPM Sprint
Testing
Screenshots
Changelog
PaymentSheet