-
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
Allow Long as amount for Google Pay Launcher #6912
Conversation
27ce17a
to
d60a838
Compare
Diffuse output:
APK
DEX
|
...ts-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncher.kt
Show resolved
Hide resolved
import kotlinx.parcelize.Parcelize | ||
|
||
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) | ||
class GooglePayPaymentMethodLauncherContractV2 : |
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.
Sad that this is needed. Can we document these somehow to fix up in our next major revision?
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.
Yep. This and PaymentSheetContract
are the two contracts that are unfortunately public, though this pull request deprecates the latter. Everything that’s deprecated can then be removed in the next major bump.
a62fa44
to
9e501a5
Compare
/** | ||
* ISO 4217 alphabetic currency code. | ||
*/ | ||
data class TransactionInfo internal constructor( |
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.
Keeping this constructor internal for now. We need to investigate if GooglePayJsonFactory
and TransactionInfo
actually need to be public or if we can make them internal and point to using GooglePayLauncher
(see this note).
@JvmOverloads | ||
fun present( | ||
currencyCode: String, | ||
amount: Int, |
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.
Making amount
non-optional to avoid a conflicting methods error.
9e501a5
to
4a772c2
Compare
4a772c2
to
97926d2
Compare
Summary
This pull request makes it possible to launch
GooglePayPaymentMethodLauncher
with an amount as aLong
instead of anInt
. This is more consistent with the rest of our API.We deprecate the
present()
method that uses anInt
and also deprecateGooglePayLauncherContract
andGooglePayPaymentMethodLauncherContract
themselves, as we’d want to make them internal. Consumers of the SDK should use the launchers directly.Motivation
Consistency and smaller API surface.
Testing
Screenshots
Changelog
GooglePayPaymentMethodLauncher
can now be presented with an amount of typeLong
. The method to present with anInt
has been deprecated.GooglePayLauncherContract
andGooglePayPaymentMethodLauncherContract
have been deprecated and will be removed in a future release. UseGooglePayLauncher
andGooglePayPaymentMethodLauncher
directly instead.