#sahilasopa-android
1 messages ยท Page 1 of 1 (latest)
Hi there ๐
The transition between this 2 state, takes around 10 seconds for the first time and 3 seconds for other
Hello, how are you doing
I'm doing alright, what can we help with?
I have described my issue above
Would you mind clarifying what your concern is about the behavior that you described? Is it the length of the initial loading time, or the difference between the two times?
the problem is, initial loading time is a lot, which gives user a bad ux
Gotcha, and are you running this test on a physical device or on a simulated one?
physical
And is it happening consistently across multiple types of network connections (cellular vs wifi)?
yes, and multiple devices as well
another quick question, does stripe support google pay in india?
No, we do not support Google Pay or Apple Pay for customers in India.
okay, but how can I fix my payment sheet loading time
I'm not sure off-hand, but am digging into it with my team.
Hello ๐
Stepping in here
Would you mind sharing an example PaymentIntent ID you're using to render the PaymentSheet?
where can I get that
alright, thank you for trying
You can either find it via dashboard under request log
https://support.stripe.com/questions/finding-the-id-for-an-api-request
OR
You can print it out when your app calls the API to create a PaymentIntent and receives a response
So step 3 in this guide
https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=payment-sheet#add-server-endpoint
req_iiYYWevBhvn53k
that's for elements. You'd want to look for a POST request to /v1/payment_intents
which creates a PaymentIntent
there are none for them, in the logs
wait I got them
but the last one according to logs was 2 days ago
huh interesting.. Do you have multiple Stripe accounts by any chance?
Nope
but yes, 2 days ago I was using one time payments, but now I am using subscriptions
Is your server-side code creating a subscription and then returning the PaymentIntent for the latest invoice?
Okay, pulling up the last subscription created in testmode
do you want me to share the ID?
Nope, I looked it up based on the other request you shared
this request to create the subscription was completed in under 2 seconds from our end
https://dashboard.stripe.com/test/logs/req_1Tt5X1WzO1pH8M
The reason I was looking for this was to make sure that the PaymentIntent creation on our end isn't delaying the rendering of the PaymentSheet in your app.
So with that out of the way, the next suspects could be
- Latency between your app and your own backend server
- UI/Any other logic/Code that runs in the background while your app is making a request to get the PaymentIntent and render the PaymentSheet
actually, everything until creation of subscription goes well, once the backend returns the client_secret after that I launch the PaymentSheet UI, but that UI takes around 10 seconds to load for the first time
Have you logged out the timestamps by any chance?
nope
If not, I'd recommend adding print statements in client-side & server-side code
just to make sure
alright, but there's no way to log the payment sheet login time as its done on the stripe end
I would share a screen recording to make it clear
req_iiYYWevBhvn53k
The request ID you shared above to/v1/elements/sessionswas relatively fast (completed in under ~2 seconds)
as you can see I load the payment sheet at 0:13 but its loads at 0:32 for the first time
but takes around 3 seconds to load for the second time
Yeah thats quite slow, do you see anything error/logs in your logcat once you click the button to present the PaymentSheet?
there are no error/logs, but I will re check, give me a moment
Nope, there are no logs related to this
although this gets logged as soon as the payment sheet is finished loading
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateList.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
Method void androidx.compose.runtime.snapshots.SnapshotStateList.update(kotlin.jvm.functions.Function1) failed lock verification and will run slower
I am unsure if it has anything to do with stripe
Not sure, could be a dependency!
Can you try downloading the example App and see if you are running into the same issue with that?
https://github.com/stripe/stripe-android/tree/master/paymentsheet-example
I already tried cloning this repo
I tried downloading the zip as well, but for some reason the zip says the zip file is invalid and git clone gives bunch of errors, I contacted another person from stripe support they said its something wrong with windows
for the zip file
fortunately it woked this time, I will run the app and update you
oh that's quite weird. Have you tried using a different zip program like winrar to see if that helps?
Windows' inbuilt tool may have some issues
ah great
yes I just downloaded winrar and it seemed to work
I will update you after I am done running the app
๐
almost done
I was having trouble running the project, lots of gradle error, but they were from my side, as they are fixed now the project is being build
๐
idk why but importing project is taking too long, as the stripe-android is a huge project
no worries, take your time
sahilasopa-android