-
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
Integrate Sunbit on PaymentSheet #8595
Conversation
Diffuse output:
APK
DEX
ARSC
|
bacb263
to
032dfe0
Compare
The Bitrise run on this PR failed, some tips to get it to pass:
|
CHANGELOG.md
Outdated
@@ -2,6 +2,12 @@ | |||
|
|||
## XX.XX.XX - 20XX-XX-XX | |||
|
|||
### PaymentSheet | |||
* [ADDED][8595](https://github.com/stripe/stripe-android/pull/8595) PaymentSheet now supports Sunbit for PaymentIntents in private beta. |
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/should we link to info about the beta in case merchants are interested in joining? Not sure if that makes sense for private beta or not
Also a nit, but can you match the wording we used for Multiblanco in the changelog for consistency?
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.
Good question. Generally, we're the ones who reach out to users for Private betas, but if someone was excited to use it and wrote into Stripe, we could add them (assuming they met our criteria).
I removed the private beta wording to follow Multibanco since our release cycle isn't super relevant to this change.
@@ -1098,6 +1098,23 @@ data class PaymentMethodCreateParams internal constructor( | |||
) | |||
} | |||
|
|||
/** | |||
* Helper method to create [PaymentMethodCreateParams] with [PaymentMethod.Type.Sunbit] as the payment |
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 you know why this is showing the fully qualified type name here (PaymentMethod.Type.Sunbit
)? Can it show Sunbit
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.
At the time of this comment, we didn't have a Sunbit
method. I added it in here (and piped it through in a few places), but I'm not sure if we get much value out of it.
Here's the commit, let me know if you think we should take this approach for the other payment methods.
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.
Hm agreed that it doesn't seem like we get much value out of it and it looks like we didn't do this for Multibanco or Amazon Pay, so I don't think we need it here either or for the other payment methods. Sorry for the churn!
settings[CurrencySettingsDefinition] = Currency.USD | ||
} | ||
|
||
@Ignore("Complex authorization handling required") |
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.
Does this need to be ignored? Using this annotation makes it so the test doesn't run
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.
This is safe to enable! Just removed this line
also can you update the PR description on this when you get a chance? |
032dfe0
to
2455f36
Compare
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.
Rather than updating this screenshot, can we update the test so that Sunbit isn't shown? You should be able to do this by updating the settings here by setting the AutomaticPaymentMethodsSettingsDefinition
to false and SupportedPaymentMethodsSettingsDefinition
to card, amazon_pay, klarna
.
Motivation for this is:
- the point of this test is testing the payment sheet appearance in general, not LPMs, so Sunbit isn't needed here
- I expect these tests might need updating on each LPM PR you did
- most importantly, when payment method orders change it can lead to our screenshot tests flaking. In this case, the best way to avoid that is probably to just not display Sunbit here
If this isn't straightforward, you could also just add Sunbit to the existing payment method order so that at least we avoid the flakiness issue due to reordering
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'm glad that you're considering future flakiness! I'd love it if this is the last time a LPM integrating team needs to update this test 😅
I tried explicitly setting the payment method list and it caused other tests to fail (because the tests are pretty reliant on autoPM).
Looking forward, we have a couple of options to avoid flakiness:
- We explicitly set the LPM list for each test individually
- We update the screenshot here and add
sunbit
to the list ordering. Since there will only be 4 payment methods visible at one time, additional payment methods shouldn't affect this.
If we want these tests to also validate how we handle automatically selecting payment methods, it would be better to go with option 2. Otherwise, option 1 would be more durable
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 only reason this test is failing is because there were only 3 visible payment methods up until now (it's the only test where the merchant is in the US). Sunbit will bring it up to 4 which should prevent failures like these from happening in the future
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 think we're not interested in testing auto PMs in this test, so setting the LPM list for the test individually sounds good! It looks like that's what you did so thank you!!
Summary
Adding the Sunbit payment method to Payment Element and StripeJS. For information about Sunbit and why we're integrating it, check out its product brief and API review doc.
Motivation
Testing
Screenshots
Screen.Recording.2024-06-06.at.8.06.39.PM.mov
Changelog