#bhaal22
1 messages ยท Page 1 of 1 (latest)
What's the paymentIntent ID?
pi_3OQ9rRGn3FuAFiGU1bQo5Y4b
my service has been notified with this payload :
Parameters: {"stripe_confirmation_result"=>"{"error":{}}", "order_id"=>"17190886"}
How do you get notified? via webhook?
I just checked this payment, it succeeded without any errors.
What made your system think it's failed?
i am not sure to have been notified by webhook
do you have a way to check it of a webhook has been sent?
I did not configure anything
i might indeed have an issue on my side
You said your servie was notified about a failure, so I'd like to know what information you service relies on to determine the status of the payment
my code expects a payment_intent in the payload
What payload?
Started POST "/stripe_connect_payments/17190886/handle_payment_confirmation"
got this payload : {"stripe_confirmation_result"=>"{"error":{}}", "order_id"=>"17190886"} in the body
This is not a public API endpoint from Stripe.
And how does your service communicate with Stripe?
Anyway I strongly recommend you using webhook to get notified https://stripe.com/docs/webhooks/quickstart
i would need to understand the payload in fact
almost everytime I receive this paylaod :
{"stripe_confirmation_result"=>"{\"error\":{\"code\":\"payment_intent_authentication_failure\"}}", "order_id"=>"17197690"}
This is not a payload that Stripe generates
it is
I believe this is a payload that your service generates.
But I have no insights why your service returns error even though the payment succeeded.
nah
the endpoint handle_payment_confirmation is my return url
when I confirm a payment
And I'd highly recommend you integrating webhook so that you can get the notification directly from Stripe without going through additional layer.
so stripe system returns back on my return url doing a POST with a payload
and what I need to fully understand is the payload attached
to the return URL
I still don't understand what your system is trying to achieve here. If the purpose is to get notified about payment status, please use webhook.
whatever system i need to understand the interface
you notify the system with a payload
There is no payload sent to the return_url, just some query parameters in the URL including the pi_xxx ID
ok query param ๐
then in the case of my pi
I just have error
{"stripe_confirmation_result"=>"{"error":{}}", "order_id"=>"17190886"}
no pi
reason why I rejected the payment on my side
but looks successful on stripe side
As stated by my colleague, that JSON does not match a payload our API would return
moment its maybe not a json in the body
give me 5 mins
someone is doing a POST on the return URL
adding the payload I shared
when theres a payment issue
the payload is a bit different
example :
stripe is the only system capable of generating payment_intent_authentication_failure
right?
its not a json as is, its how my backend is rendering the params (body or query param)
Sorry, I've no idea what you're sharing with me. We wouldn't send a POST to the return_url, only a GET for the redirect
ok my bad apologies
I found potentially an issue
I followed this guide :
if (result.error) {
// Inform the customer that there was an error.
}
});```
and my code :
clientSecret: client_secret,
confirmParams: {
return_url: url
}}).then(function(result) {
var value;
if (result.error) {
value = {
error: {
code: result.error.code,
decline_code: result.error.decline_code
}
}
} else {
value = result
}```
and in that case of that PI looks like there is an error with no value
do you have a way to get payload of the confirmPayment by chance?
is there a possibility for error to be empty but still be valid?
Sorry, catching up
no worries
Hmm, error shouldn't be empty in this case. It should look like:
{
type: '',
message: ''
}
So I think you're using the wrong keys
most of the times I have the right errors
when I generate such a payload
stripe_confirmation_result"=>"{\"error\":{\"code\":\"payment_intent_authentication_failure\"}
The code key is from backend errors
You need to look at the JS reference for confirmPayment payloads
ok I can use
If the confirmation fails, the Promise will resolve with an {error} object that describes the failure. When the error type is card_error or validation_error, you can display the error message in error.message directly to your user. An error type of invalid_request_error could be due to an invalid request or 3DS authentication failures.
yes
then in the case of this confirmation
if (result.error)
is true
then I understand it as an error
but payments looks to be confirmed on stripe side
i suspect its because 3ds failed
but payments still success
but im not sure at all
The confirmPayment Promise won't resolve until after any required 3DS attempts are done
Is there an example pi_xxx that exhibits this?
Let's see
Seems expected given there were 2 confirmation attempts:
- 3DS was requested on initial attempt. Don't think that was ever completed by customer: https://dashboard.stripe.com/logs/req_rjAGmSHZXnjGZn
- 2nd confirmation attempt succeeded without 3DS request: https://dashboard.stripe.com/logs/req_vsLzLAgXIgy0L7
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.
hmmm
does it mean on "first" attempt, the js sdk had empty error ?
empty error code,decline_code
As I explained, code and decline_code aren't fields/keys in the error hash returned from confirmPayment which is why they're undefined in your code
Yup, error.type and error.message
it does not mak eeasy
How? confirmPayment will only ever return an error with one signature
no
The other error signature is for backend requests
๐
read the link I shared
there are different types of errors
and attributes are dependent
i cannot console.log
of course
but will do something indeed
do you know how I can reproduce the "same" scenario with test cards?
{
"type":"invalid_request_error",
"code":"payment_intent_authentication_failure",
}
Is the payload for a 3DS failure
something is still weird in that case
my code is doing
value = {
error: {
code: result.error.code,
decline_code: result.error.decline_code
}
}```
and I generated this payload
"error":{}
means code and decline_code were null
or non existent in the object result.error
Did you log result.error as advised? I'd be very surprised if it was empty
no i did not
it happened on Dec 22nd
this is why I wanted to know if you could have the result.error
retroactively
will add also the message
What are you trying to do retroactively?
having the result issued from the promise
you shared with me the json result from the rest api. I am curious how the SDK wraps it into the result object
with result.error not empty
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Could you summarise the latest question for me please?
of course ๐
My code is calling :
clientSecret: client_secret,
confirmParams: {
return_url: url
}}).then(function(result) {
var value;
if (result.error) {
value = {
error: {
code: result.error.code,
decline_code: result.error.decline_code
}
}
} else {
value = result
}```
building a value object with code and decline_code
looking at the logs from my backend, both attributes are empty
my question is : can we rebuild the result.error which looks to existing
ynnoj shared with me this log
but from this response I do not see anything relevant regarding the error object
What do you mean by "looks to existing"?
if (result.error) is true
means result.error exists in the payload
but code and decline_code dont
Are you trying to understand if result.error can be anything truthy but an object with code and decline code parameters?
yes
regarding stripe doc
if result.error exists then its an error
and in the case of my pi_xxx I dont know what I should have done
this is why I wanted to know if we could get back the whole payload returned by the promise
I could analyze it
No, errors on the frontend always has the same structure. So it's not possible. There might have been some other problem.
We can't see what happened there beyond the API response: https://dashboard.stripe.com/logs/req_rjAGmSHZXnjGZn
this is my concern ๐
will add mor logs
i am concerned because then it triggered disputes
and costs money
Does this happen often?
Please add more logs to see what was the actual error and monitor closely. If this happens again, feel free to reach out to us.