#morey-payments

1 messages · Page 1 of 1 (latest)

still igloo
#

Hello!

terse lynx
#

Hi again!
"client_secret":"pi_3JjsuuLXSN9kljfY1ArOZ6uQ_secret_dWJpRtgw6zfnjGa3dLDTafayN",

was the client secret i sent in that

still igloo
#

What are you trying to do here? Is there a reason you're not just using a Payment Intent ID to retrieve server-side?

terse lynx
#

Ah, I was trying to do it earlier from front -end

    // Hide the 3DS UI
    yourContainer.remove();

    // Check the PaymentIntent
    stripe.retrievePaymentIntent('{{PAYMENT_INTENT_CLIENT_SECRET}}')
      .then(function(result) {
        if (result.error) {
          // PaymentIntent client secret was invalid
        } else {
          if (result.paymentIntent.status === 'succeeded') {
            // Show your customer that the payment has succeeded
          } else if (result.paymentIntent.status === 'requires_payment_method') {
            // Authentication failed, prompt the customer to enter another payment method
          }
        }
      });
  }

  window.addEventListener('message', function(ev) {
    if (ev.data === '3DS-authentication-complete') {
      on3DSComplete();
    }
  }, false);```

but retrievePaymentIntent was null on the react package
#

so. Itried verifyin on server. But I Iguess I misread documentation

still igloo
#

Hmmm... you should be able to retrieve a Payment Intent client-side. Were you getting some kind of error?

terse lynx
#

Backend worked after just using the .id 😄

#

Moment, lemme get the client end code

still igloo
#

Glad to hear it works from the backend now!

terse lynx
#

`TypeError: Cannot read properties of null (reading 'retrievePaymentIntent')

`

#

Used it like this

          payment_intent_client_secret_string,
        );```
#

strange I refreshed and it now worked

#

0 code change

still igloo
#

So now it works?

terse lynx
#

nope

#

this was the string passed: pi_3JjsuuLXSN9kljfY1ArOZ6uQ_secret_dWJpRtgw6zfnjGa3dLDTafayN

still igloo
#

What did you mean when you said "strange I refreshed and it now worked"?

terse lynx
#

one of the times I refreshed earlier it actually got me the stripeIntentResult

#

But I can't replicate it

still igloo
#

Gotcha - so I'm guessing the issue is that Stripe hasn't fully loaded by the time you're making this request. You need to take a look at your code and make sure you can guarantee it's load at that point

terse lynx
#

ya I logged abit more. Looks like stripe wasn't loaded propely at time of call

#

thanks!