-
Notifications
You must be signed in to change notification settings - Fork 661
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 support for downloading images for LUXE payment methods. #5928
Conversation
Diffuse output:
APK
DEX
ARSC
|
|
||
/** | ||
* The customer's selected payment option. | ||
*/ | ||
data class PaymentOption( | ||
data class PaymentOption | ||
@Deprecated("Not intended for public use.") |
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.
Should call this out in the changelog?
/** | ||
* The drawable resource id of the icon that represents the payment option. | ||
*/ | ||
@DrawableRes val drawableResourceId: Int, | ||
@Deprecated("Please use fetchIcon 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.
Should call this out in changelog?
/** | ||
* Fetches the icon associated with this [PaymentOption]. | ||
*/ | ||
fun icon(): Drawable { |
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 new public API. Should be in the changelog.
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 catch. I updated the Changelog with the suggested items.
private val paymentOption: PaymentOption, | ||
) : Drawable() { | ||
init { | ||
@OptIn(DelicateCoroutinesApi::class) |
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.
Since this is used in integrators code, what happens when this API changes? Wouldn't the integrator be forced to update Stripe SDK version? Should we be more careful 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.
This is a stable API. The annotation has a description of:
Marks declarations in the coroutines that are delicate — they have limited use-case and shall be used with care in general code. Any use of a delicate declaration has to be carefully reviewed to make sure it is properly used and does not create problems like memory and resource leaks. Carefully read documentation of any declaration marked as DelicateCoroutinesApi.
Basically saying don't use this unless you're really sure you want to. In our case, I think it's the right API to use (GlobalScope), due to us not being in coroutines/structured concurrency land.
Summary
Different approach to #5851
Motivation
https://paper.dropbox.com/doc/LUXE-Milestone-Images-V2--BtOExZa66TaUp8wYBzPWDezaAg-oIaL68ZVfjQ8J64zthANK
Testing
Screenshots
Changelog