#Omri
1 messages · Page 1 of 1 (latest)
When this PaymentIntent was created, it had
payment_method_types: {
0: "card"
}
So it's expected that only card payment will appear.
Oh sorry, Google/Apple Pay are included in card. But you need to make sure you follow all the requirement to see them displayed on your page: https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-testing
cool, it is works, but I cannot click on the pay button on the Payment element in google pay section, the button is disabled
What do you mean by "disabled"? What happens when you click on the big blue button?
nothing, and nothing in the console
And if you select card, fill the form, and click on the blue button, what happens?
ohh it is work with the blue button, but we have issue with Apple pay only, checking with our support again and let you know
For Apple Pay make sure you follow are the requirements listed here: https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-testing
This includes: HTTPS URL, using Safari, have a card in your wallet, and have verified your domain with Stripe
we have that issue https://github.com/stripe-archive/react-stripe-elements/issues/335
we call to const result = await stripe.confirmPayment({ elements, confirmParams: { return_url: returnUrl, payment_method_data: { billing_details: { email: email, name: fullName, phone: phone, address: { city: city, country: country, line1: address1, line2: address2, postal_code: zip, state: state } } } }, redirect: 'if_required', })
Hmm, that should be unrelated as you're not using Payment Request Button directly
What's the issue exactly?
when I click on give now, the Payment Element is stuck, like in the pic
IntegrationError: show() must be called from a user gesture handler (such as a click handler, after the user clicks a button).
that the error form the console
What other code are you calling before confirmPayment?
Or can you share your function that triggers confirmPayment?
setLoading()
setDonationError('')
if (!stripe || !elements) {
return
}
const result = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: returnUrl,
payment_method_data: {
billing_details: {
email: email,
name: fullName,
phone: phone,
address: {
city: city,
country: country,
line1: address1,
line2: address2,
postal_code: zip,
state: state
}
}
}
},
redirect: 'if_required',
})
if (result.error) {
console.log(result)
// This point will only be reached if there is an immediate error
setDonationError(result.error.message)
setLoadingDone()
setPaymentSubmit('stripeError')
} else {
setStripePaymentIntent(result.paymentIntent)
setPaymentSubmit('stripeDone')
if (subscriptionValues.isSubscription) {
setLoadingDone()
submitDonationSuccess()
}
// Your customer will be redirected to your `return_url`. For some payment
// methods like iDEAL, your customer will be redirected to an intermediate
// site first to authorize the payment, then redirected to the `return_url`.
}
}```
it is happened only with Apple pay
Is there somewhere I can reproduce this?
Yeah I think this is an issuer where Apple requires the Apple Pay modal to be presented within a certain timeframe after being initiated
sure
1 sec
- click on
make a gift
- select one of the campaign from the left list
- click
continue
- fill all the required fields and click
confirmation
- click
pressed with payment
- select Apple Pay
- click
give now
that's it
I'd prefer not to have to complete those form fields
Let's see
At what point you initialise the Payment Element?
I mean in the code
I suspect the issue is tat the Payment Element is initialised too early
<Elements stripe={stripePromise} options={options}>
<StripeCheckoutForm />
</Elements>
</div>```
Do you definitely have an active card in your Apple Pay wallet?
yes, I have, and 3 different persons tested it with active card in Apple Pay wallet
Hey! Taking over for my colleague. Let me catch up.
Hey, there is an option to video chat?
that's not an option we offer.
Looking at your code, it’s probably because the confirmation call is triggered from a useEffect handler. I don’t know why you do that instead of the submit action of a “pay” button. Does it work if you do it with a normal submit action?
i.e. the approach in our docs (https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements&html-or-react=react#web-submit-payment) where it's triggered from a <form onSubmit handler.
I'll try it
there's basically two causes of this
a) you are calling confirmPayment outside the context of a gesture handler(JS function handling a button block or keyboard event etc), usually because you you call it from the callback of an async action, or some other context entirely
b) you are calling from a gesture handler, but the time between the start of the event and you calling it was too long, so Safari decided it doesn't count.
Here it is probably a). And because of that limitation it's generally better to try to make the code that integrates the PaymentElement as simple as possible and not try to use too many layers of components or passing functions or events around between them. A basic form submit or button onclick would always work