-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#109] Handle potential init exceptions and fallback #113
[#109] Handle potential init exceptions and fallback #113
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
c3351e1
to
49c63d8
Compare
49c63d8
to
0678b26
Compare
this.initialize( | ||
ButtonOptions.newBuilder() | ||
.setButtonTheme(theme.value) | ||
.setButtonType(type.value) | ||
.setCornerRadius(radiusPixelValue) | ||
.setAllowedPaymentMethods(allowedPaymentMethods) | ||
.build() | ||
) |
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 block can be broken by "Fatal Exception: java.lang.IllegalStateException" or other potential crashes requiring handling and a potential fallback.
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.
LGTM.
I will do a |
As discussed in this issue #109, this library serves as a Compose UI wrapper for the "PayButton" View, initializing within the Compose function.
It may crash for various reasons; thus, this PR introduces an
onError
callback and afallbackUi
to prevent the client app's payment flow from breaking.