#saneewhy-PI-error
1 messages ยท Page 1 of 1 (latest)
Hi there! Can you share the request ID? That sounds like an object lock: https://stripe.com/docs/rate-limits#object-lock-timeouts
pm_1LGQGG2HIPBIdkNuF9XtQFUb is this it?
That's the PaymentMethod ID but it will work
Alright
Hmmm no actually I'm not seeing that error on your account.
Where are you seeing the error specifically?
In your terminal?
Or client side?
In my terminal
And that is the full error?
Ah you are using Flutter
Can you share that PaymentIntent ID that is in the error message
sure
Or rather, can you post that full screenshot as text
{"provider":"STRIPE","user":{"guId":"YM0a26WAbJ"},"payment":{"type":"s_card","nonce":"pi_3LGQJG2HIPBIdkNu11i8XMd0","isSaveCard":false,"paidAmount":"15.00","txnAmount":"15.00","subscriptionAmount":"0.00","oneTimePayment":"15.00"},"itemList":[{"guId":"oYdv7jkG2N","billingDay":0,"noOfBillingCycles":0,"txnAmount":"15.00","subscriptionAmount":"0.0","finalSubscriptionAmount":"0.00","oneTimePayment":"15.00","finalOneTimePayment":"15.00","membershipExpEpoch":"1659112424"}]}
I/flutter (17983): {"error":{"message":"Method Id already used"}}
here
Huh that PaymentIntent mentioned was successful.
Where in your code is this error getting thrown?
Yes I'm aware
After calling the confirm payment intent function
Can you share your code
var paymentMethod = await createPaymentMethod(
cardDetails.number!,
cardDetails.expirationMonth.toString(),
cardDetails.expirationYear.toString(),
cardDetails.cvc.toString());
if (paymentMethod.statusCode == 201 || paymentMethod.statusCode == 200) {
var paymentMethodResponse = jsonDecode(paymentMethod.body);
if (paymentMethodResponse['id'] != null) {
var intent = await paymentIntent(total.value.toInt() * 100);
if (intent.statusCode == 201 || intent.statusCode == 200) {
var paymentIntentResponse = jsonDecode(intent.body);
if (paymentIntentResponse['secret'] != null) {
if (paymentIntentResponse['id'] != null) {
var id = paymentIntentResponse['id'];
var methodId = paymentMethodResponse['id'];
var confirm = await confirmPayment(id, methodId);
if (confirm.statusCode == 201 || confirm.statusCode == 200) {
var responseBody = jsonDecode(confirm.body);
if (responseBody['id'] != null) {
var temp = await getItemInvoiceStripe(
item, responseBody['id'] ?? '', offerCode.value.id ?? "");
promoLoading.value = false;
if (temp.guId != null && temp.guId!.isNotEmpty) {
Get.back();
Get.back();
Get.off(() => const SuccessFulPayment());
}
} else {
promoLoading.value = false;
showToast("Unable to find Client's Id");
}
} else {
promoLoading.value = false;
showToast("Something went wrong!!");
}
}
}
}
}
This is my payment function
Is checkout call mandatory after every transaction?
Because I haven't included it yet
Is that what might be causing the error?
What do you mean by "checkout call"?
You mean confirmPayment()?
Ah okay
So the error you are seeing is based on the PaymentMethod
Since you are setting the PaymentMethod as methodId
no I mean https://api.stripe.com/v1/checkout/sessions this call
Hi ๐ I'm stepping as @meager remnant needs to step away
The start of your question is about confirming a payment intent, you shouldn't need to do anything related to Checkout Sessions. That is an entirely different process.
Can you share the documentation for the flow you are following?
For example
https://stripe.com/docs/api/payment_intents/confirm this is what I'm trying to follow
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay.
The doc you linked is just an API reference doc. I'm trying to understand your overall process flow.
Could you describe, overall, what you are trying to accomplish and where you are running into problems.
Okay so I'm trying to integrate stripe with the payment process in my mobile application using flutter
I've used all the apis and the transaction is successful but stripe is showing the above error at the end of every transaction
So all API requests are successful?
Yes except for https://api.stripe.com/v1/payment_intents/pi_1DrN4f2eZvKYlo2CYb4EXe4e/confirm this one
Could you please share the request ID from your logs?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
That link is not something I can examine
req_dN7IETUJEsu9rC
Thank you! Looking now
That is a GET request. All this does is retrieve the Payment Intent.
Great, thanks
This looks like a successful PI confirmation. What part of this app is failing?
There's a toast message that says "methodId already used" and the same is displayed in the terminal
Can you tell me what are the next steps after this call?
The payment confirmation has succeeded. The charge has been made. Report success to your user.
The Payment Intent that is returned from this API call includes the status of succeeded. You can use this to indicate to your user that their payment was successful.
Okay