#yogenp
1 messages ยท Page 1 of 1 (latest)
I guess that error is shown when you press pay? Can you add some logging into your Android call around the Payment Sheet method as there is likely errors thrown
Yes, @quick bloom I get this error after pressing Pay. I've added logging until I call CreateIntentResult.Success(response.clientSecret) and everything looks good until then. Let me know if I could add any logging after this statement.
If your backend successfully creating the Payment Intent?
Do you have a catch block to handle scenarios where the create intent callback fails?
try {
val response = myNetworkClient.createIntent(
)
CreateIntentResult.Success(response.clientSecret)
} catch (e: Exception) {
CreateIntentResult.Failure(...)
}
I expect there to be something in that catch block
Yes, I have wrapped everything in a try catch and there's nothing in the catch block either.
And your backend code is definitely creating and returning a Payment Intent?
try {
---
if (result.isSuccess()) {
LoPayLogger.i("Received payment Intent: ${result.extractData().clientSecret}")
CreateIntentResult.Success(result.extractData().clientSecret)
} else {
CreateIntentResult.Failure(NullPointerException(""), "")
}
} catch (e: Exception) {
LoPayLogger.e("Failure: ${e.message}")
CreateIntentResult.Failure(e, e.message)
}
Yes, I can share the Payment intent with you in a DM if that helps.
No need for a DM. But you're going to need to share more of your code really
Are you sure that that code is even beign triggered? You need to add logging to figure our which code is problematic
Yes, I'm sure it' being triggered as I'm seeing the network call to my backend in the Logcat and the logging statement LoPayLogger.i("Received payment Intent: ${result.extractData().clientSecret}") is also being triggered every time.
I'm happy to add more logging wherever you recommend.
This is the full code btw
paymentSheet = PaymentSheet(
activity = activity,
createIntentCallback = { paymentMethod, _ ->
try {
stripePaymentMethodId = paymentMethod.id
val requestBody = requestBodyUtils.getRequestBodyFromDataClass(hardwareOrderModel)
val result = terminalsRepository.orderHardware(requestBody)
if (result.isSuccess()) {
LoPayLogger.e("Received payment Intent: ${result.extractData().clientSecret}")
CreateIntentResult.Success(result.extractData().clientSecret)
} else {
val error = result.extractError().toString()
CreateIntentResult.Failure(CustomException(error), "Error: error")
}
} catch (e: Exception) {
LoPayLogger.e("Failure: ${e.message}")
CreateIntentResult.Failure(e, e.message)
}
},
paymentResultCallback = ::onPaymentSheetResult
)
๐ taking over for my colleague. Let me catch up.
Sure, thanks.
would you mind sharing a request ID?
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
On it
req_hB7vaN36g08yUk is the one for creating a Payment Intent and after that, I can see a GET request to the created Payment Intent at req_EvYuunIVyqVFKF
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I'm looking into this, will be with you shortly
Thanks @eternal raft
@sacred island this is taking more than I was hoping, would you mind writing to us to https://support.stripe.com/contact/email?topic=api_integration and add all the details necessary (version of Android you're working on, target version, etc...) and code snippets backend/mobile and the request IDs so we could try to build and reproduce this issue?
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
and this way we can stay in touch asynchronously
Sure, on it. Is there an alternative I could try while you look into it?
could you try this https://stripe.com/docs/payments/accept-a-payment?platform=android ?
I'm a bit curious to see whether this is related to the deferred flow in particular
I'll give it a go and post an update here.
Just some additional contextual information:
When I use the Card Element only, everything works fine. We're implementing some new changes wherein we need to store the paymentMethodId for future purposes. That's when I started looking into this and received the discussed error.
I managed to implement this successfully for Google Pay using stripe?.confirmPayment(activity, confirmParams). And now I'm stuck for Cards.
could we try something for now
can you leave your mobile code as is
and just remove setup_future_usage from your backend call when creating the PI?
On it.
please ping me when you're back
Yep, my backend team is just making that change. I'll share results here as soon as I have them.
๐
Btw, while they're doing it, I implemented the "Accept a payment" flow and worked fine.
with setup_future_usage?
Yes, as we have now. I'll be able to share the results without setup_future_usage very shortly.
would you mind sharing the request ID or the PI ID that succeeded?
I'm a bit confused on why there's a Payment Method in this request req_hB7vaN36g08yUk
That's what we're implementing, storing paymentMethod and using it in the future for other purposes. Should it not be there?
Should it not be there?
not while creating the PI
you need to create the PI
and the PaymentSheet will take care of adding the PM when confirming
Very interesting, someone needs to answer some questions it seems then ๐
Give me a min, and I'll get back to you.
Btw, this is PI that succeeded: req_keB38WWz6de9MM ("Accept a payment") with setup_future_usage
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
@eternal raft Removing setup_future_usage works like a treat(still sending the paymentMethod though). I'm having a chat with my backend team about paymentMethod and potentially removing it.
@sacred island once you have all the results please contact https://support.stripe.com/contact/email?topic=api_integration and give us all the necessary information so we could try to reproduce and understand exactly what's happening
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Will do, thanks for the help.