#Alexey.Drabushev

1 messages · Page 1 of 1 (latest)

grand willowBOT
tardy island
#

Hi there!

#

Can you share the request ID (req_xxx) here?

iron abyss
#

req_Dpjk0uyS1rgk7B

tardy island
#

Here the issue is Stripe blocked that payment. So ask your customer to try with a different card.

iron abyss
#

yes. I understand. but the question is "how can I hanlde the tokens request, if I use { PaymentRequestButtonElement, Elements } from '@stripe/react-stripe-js';
"

#

in order to show the error message

tardy island
#

I'm not sure I understand. What are you trying to achieve?

iron abyss
#

If user trying to pay with the blocked card, just putting the card details in payment form, I can show him/her an error message using the stripe.createPaymentMethod request.
But when it happens via Apple Pay I don't have an access to this method. I use paymentRequest.on('paymentmethod'), but the tokens (screenshot) request doing before

tardy island
#

Which error message exactly you would like to display? The one in error.message from your screenshot above?

#

And currently what error message is displayed to users? Car you share a screesnshot?

iron abyss
#

yes, I want to show error.message.
but I didn't show any UI alerts because I don't know how to handle tokens request

#

I'm using the flow like this:

const pr = stripe.current.paymentRequest({});

pr.canMakePayment().then((result) => {
  if (result) {
    setPaymentRequest(pr);
  }
});

pr.on('paymentmethod', async (e) => {
  onPurchaseClick();
});

<Elements stripe={stripePromise}>
  <PaymentRequestContainer>
    <PaymentRequestButtonElement
      options={{ paymentRequest }}
    />
  </PaymentRequestContainer>
</Elements>
tardy island