#izaerax-google
1 messages · Page 1 of 1 (latest)
hi Soma, I have followed the guide to create a paymentRequest button to pay with google_pay / apple_pay, but I can't figure how to close the payment modal and give and error message in case something went wrong.
I've notice that there are few methods but I cant find in the doc how to use those.
There's the list:
abort: ƒ (r)
addEventListener: ƒ (r,o)
addListener: ƒ (r,o)
canMakePayment: ƒ (r)
emit: ƒ ()
hasRegisteredListener: ƒ (r)
isShowing: ƒ ()
off: ƒ (r,o)
on: ƒ (r,o)
once: ƒ (r,o)
removeAllListeners: ƒ (r)
removeEventListener: ƒ (r,o)
removeListener: ƒ (r,o)
show: ƒ (r)
update: ƒ (r)
So I just checked, and it doesn't seem possible to programatically close the modal.
Yes, you could try to call ev.complete('fail'), as mentioned in the tutorial here: https://stripe.com/docs/stripe-js/elements/payment-request-button#html-js-complete-payment
but I cant change the error message 😦
so you can confirm me that there isn't a way to close/show a personalized error message?
As far as I know, yes. But you could display a custom message on the payment page itself (not the modal).
Ok thank you Soma 🙂