#bhaal22

1 messages ยท Page 1 of 1 (latest)

hasty patrolBOT
minor pecan
#

What's the paymentIntent ID?

umbral finch
#

pi_3OQ9rRGn3FuAFiGU1bQo5Y4b

#

my service has been notified with this payload :

#

Parameters: {"stripe_confirmation_result"=>"{"error":{}}", "order_id"=>"17190886"}

minor pecan
#

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?

umbral finch
#

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

minor pecan
#

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

umbral finch
#

my code expects a payment_intent in the payload

minor pecan
#

What payload?

umbral finch
#

Started POST "/stripe_connect_payments/17190886/handle_payment_confirmation"

#

got this payload : {"stripe_confirmation_result"=>"{"error":{}}", "order_id"=>"17190886"} in the body

minor pecan
#

This is not a public API endpoint from Stripe.

umbral finch
#

no

#

this is my service

minor pecan
#

And how does your service communicate with Stripe?

umbral finch
#

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"}

minor pecan
#

This is not a payload that Stripe generates

umbral finch
#

it is

minor pecan
#

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.

umbral finch
#

nah

#

the endpoint handle_payment_confirmation is my return url

#

when I confirm a payment

minor pecan
#

And I'd highly recommend you integrating webhook so that you can get the notification directly from Stripe without going through additional layer.

umbral finch
#

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

minor pecan
#

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.

umbral finch
#

whatever system i need to understand the interface

#

you notify the system with a payload

hasty patrolBOT
dusk vapor
#

There is no payload sent to the return_url, just some query parameters in the URL including the pi_xxx ID

umbral finch
#

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

dusk vapor
#

As stated by my colleague, that JSON does not match a payload our API would return

umbral finch
#

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)

dusk vapor
#

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

umbral finch
#

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?

dusk vapor
#

Sorry, catching up

umbral finch
#

no worries

dusk vapor
#

So I think you're using the wrong keys

umbral finch
#

most of the times I have the right errors

#

when I generate such a payload

#

stripe_confirmation_result"=>"{\"error\":{\"code\":\"payment_intent_authentication_failure\"}

dusk vapor
#

The code key is from backend errors

#

You need to look at the JS reference for confirmPayment payloads

umbral finch
#

ok I can use

dusk vapor
#

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.

umbral finch
#

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

dusk vapor
#

The confirmPayment Promise won't resolve until after any required 3DS attempts are done

dusk vapor
umbral finch
#

what?

#

3ds failure but payment success?

#

this one pi_3OQ9rRGn3FuAFiGU1bQo5Y4b

dusk vapor
#

Let's see

#

Seems expected given there were 2 confirmation attempts:

umbral finch
#

hmmm

#

does it mean on "first" attempt, the js sdk had empty error ?

#

empty error code,decline_code

dusk vapor
#

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

umbral finch
#

ahhhhhh

#

it depends of the type

#

....

#

wow

dusk vapor
#

Yup, error.type and error.message

umbral finch
#

it does not mak eeasy

dusk vapor
#

How? confirmPayment will only ever return an error with one signature

umbral finch
#

no

dusk vapor
#

The other error signature is for backend requests

umbral finch
#

reading here

dusk vapor
#

Not sure what you're telling me

#

Please just console.log(result.error) and you'll see

umbral finch
#

๐Ÿ™‚

#

read the link I shared

#

there are different types of errors

#

and attributes are dependent

dusk vapor
#

No, the values differ

#

Please, just try and use the code as I've explained

umbral finch
#

i cannot console.log

#

of course

#

but will do something indeed

#

do you know how I can reproduce the "same" scenario with test cards?

dusk vapor
#
{
"type":"invalid_request_error",
"code":"payment_intent_authentication_failure",
}
#

Is the payload for a 3DS failure

umbral finch
#

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

dusk vapor
#

Did you log result.error as advised? I'd be very surprised if it was empty

umbral finch
#

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

dusk vapor
#

What are you trying to do retroactively?

umbral finch
#

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

light raptor
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

umbral finch
#

no worries

#

thank you @dusk vapor

light raptor
#

Could you summarise the latest question for me please?

umbral finch
#

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

light raptor
#

What do you mean by "looks to existing"?

umbral finch
#

if (result.error) is true

#

means result.error exists in the payload

#

but code and decline_code dont

light raptor
#

Are you trying to understand if result.error can be anything truthy but an object with code and decline code parameters?

umbral finch
#

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

light raptor
umbral finch
#

this is my concern ๐Ÿ™‚

#

will add mor logs

#

i am concerned because then it triggered disputes

#

and costs money

light raptor
#

Does this happen often?

umbral finch
#

i will double check my logs

#

i am not sure it happens often

light raptor
#

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.