#Sarvesh

1 messages ยท Page 1 of 1 (latest)

young crestBOT
opal kestrel
#

How can we help?

tribal storm
#

I created payment intent request which status shows succeed BUT I can see
type: "invalid_request_error"

#
  1. also even after click on submit, user is still on the same page and can click multiple times so how to handle this submit click event?
#
  1. I did not received any webhook response on successful payment
opal kestrel
#

Can you share the request ID (req_xxx) under request_log_url in the screenshot?

tribal storm
#

id: "pi_3M7vdFPGjJdpmYtd02Fa3GOU"

opal kestrel
#

It's invalid to confirm a successful payment since the payment has been made

#

I'd recommend removing pm_card_bypassPending from payment_method, so that you can collect payment method at frontend

tribal storm
#

ok, removed, I have set another 2 params
'confirm' => true,
'automatic_payment_methods' => ['enabled' => true],
are those fine or you want to suggest for ti?

#

if I remove payment_method, gets an error
You cannot confirm this PaymentIntent because it's missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method.

opal kestrel
#

confirm will only be useful when you have a payment_method set. In your case that the payment method is not collected, you shoul remove confirm: true.

#

Since you're going to collect a payment method, payment_method and confirm should be removed

tribal storm
#

ok and 'return_url' => $baseUrl.'/intentdata',?

#

now it gets error for it.
The parameter return_url cannot be passed when creating a PaymentIntent unless confirm is set to true.

opal kestrel
#

return_url should be set at confirm stage, so it can be removed as well

tribal storm
#

ok, I will do same

#

on submit, I need to handle event of click and redirect to some page to user or stripe will redirect?

#

and how to get webhook with payment sucess/fail etc?

opal kestrel
#

I'd recommend reading the Payment Element doc integration here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements

on submit, I need to handle event of click and redirect to some page to user or stripe will redirect?
On submit, your frontend should call stripe.confirmPayment that will handle remaining actions including redirection

how to get webhook with payment sucess/fail etc?
Webhook guide provide you how to set up a webhook and listen to an event: https://stripe.com/docs/webhooks/quickstart

tribal storm
#

ok, thank you

opal kestrel
#

No problem! Happy to help ๐Ÿ˜„

tribal storm
#

connected these webhooks. is this sufficient or need anything more?

opal kestrel
#

They look fine to me. Account is for events on your account and Connect is for the events on connected accounts

tribal storm
#

ok, so user payments success/fail will get received on these connect webhook response right?

#

which fields to specifically change in the webhook to update the payment status as success/failed?

#

*check

opal kestrel
#

Yes if the payment is a Direct Charge

tribal storm
#

ya, we are only doing direct charge payments only from the application

opal kestrel
#

Yup! Then your server will receive Direct Charge payment intent events in Connect webhook endpoint

tribal storm
#

good, which fields to specifically check in the webhook response to update the payment status as paid/failed?

opal kestrel
tribal storm
#

great, thank you!

opal kestrel
#

No problem! Happy to help ๐Ÿ˜„