-
Notifications
You must be signed in to change notification settings - Fork 132
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
Critical Crash on Payment Success Handling in Google Pay Flutter Plugin Affecting 350+ Users #274
Comments
This PR should fix: #276 (review) |
@ViniciusDeep has this fix been pushed at all? I see there were some fixes in the android package but have these been filtered through to this package? I ask as I am getting fatal crashes on receiving a payment result from Google Pay. |
Hi @SamuelMTDavies, the update is available in beta. Check out version 3.0.0-beta.2. Feel free to share insights about your experience with it. |
@JIUgia - I have upgraded and its not crashing on Android but i may have found a bug. I will post it here and if deemed necessary i will put it n a separate issue. This function I took from the advanced example:
This try block errors and the SnackBar is shown before the payment selector appears. The payment selector appears and I can get the result. The error logs:
I assume this is to do with the _googlePayResultSubscription Stream receiving Null before the paymentSelector is shown? I haven't had any chance to look into this mechanism and I don't have much android specific knowledge.
I would like to know if this code smell is right and we can account for it in the next beta version? Do you want me to open this in a separate issue? |
Hi @SamuelMTDavies, the error happens exactly at the line you are pointing out, very likely triggered by the logic called by Provider when you receiving a result. That logic is surely expecting a populated object and encountering an empty JSON string, such that when you look for certain properties in there, a Note that for platforms that use asynchronous means to return the result, calling I've also added a few extra lines in the Let me know if that works for you. |
@JlUgia Just for my own clarity. This code always returns null if the payment selector is successfully shown? (for android)
and that any result from the payment selector will be received here:
I can follow this logic but would suggest that the advanced example is updated to make this clearer and stop it from trying to Cast Null. |
Hi @SamuelMTDavies, that's exactly right. Any platform that uses asynchronous mechanisms to return a result will see I think that the null casting was never part of the There are other options to handle this, which I'll note here for potential future use based on feedback from you and other developers:
|
I've got it working in the test environments but it does seem a little temperamental. It's a pain having to test on real iOS devices and that the results come in two places depending on the device but it will have to do. Does the bool the canUserPay function returns change based on the Payment Configuration? I'm trying to understand why a Google Pay button shows up on a device with testing config and then doesn't show on the same device with production config. |
Hey @SamuelMTDavies, what feels temperamental? Are you referring to something specific? Also, is there any plugin-specific functionality that requires testing on a real device, or are you referring to the Apple Pay API? Remember that both APIs at Google and Apple Pay follow different dynamics to decide whether a user can pay in the platform. For Google Pay, these conditions are mostly structural and relate to aspects like the country where the account is operating from, the existence (and version) of Google Play services on the device, an being logged in with a valid @gmail account. Take a look at the isReadyToPay reference for more info. |
The temprementality is whether the Google Pay or Apple Pay button shows or not. I am testing across the simulator, emulator, real iPhone and android devices. Sometimes it works fine on the emulator then wont show on the real device. I have an android device that had the full flow working in the test environment and then when we tried to test a production setup the button wouldn't show. I am beginning to wonder if the string implementation of the config is too prone to formatting issues as I can see no other reason for the button to not show when removing a single line of config only. This seems to be the root of many of our issues. As for your question on implementation i personally would lean towards the first or last option. The first option feels disconnected from the package to me having the traditional _onButtonPressed, _onResultReceived, _onError is clear and clean, similarly if you can subscribe to a single stream and understand the errors that can be thrown and why thats equally workable. |
It's also odd to pass the Google Configuration the the Pay client instance and then provide the configuration a second time on the RawGoogleButton - which one is used? Its easy for people to update one and not the other, which could be easily missed. |
Crash on Payment Success Handling in Google Pay Flutter Plugin
Description:
We have encountered a critical issue in the Google Pay Flutter plugin that is causing crashes during the payment success handling process. This issue has been reported by multiple clients and is currently affecting over 350 users.
Stack Trace:
Impact:
Request for Update:
Is there any progress or update on this issue? Given the severity and impact on our users, a prompt resolution or workaround would be greatly appreciated.
Additional Information:
If any further details or logs are needed, please let us know. We're eager to collaborate to resolve this issue as quickly as possible.
The text was updated successfully, but these errors were encountered: