#john_api

1 messages ยท Page 1 of 1 (latest)

hallow talonBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1389434728813428736

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

void axle
#

Can I check what are you referring to with sessionID?

woeful nymph
#

sorry, I am using hosted, not embedded

#

@void axle

#

mode = SETUP & uiMode = HOSTED

void axle
woeful nymph
#

thanks @void axle
I went thru that but still not clear if URL will suffice.

also, this link will be sent to the customer via email. How do we get the payment method after the customer goes through? Is there webhook that we can listen to?

#

I see 'checkout.session.completed' webhook event.

void axle
#

I am unsure what do you mean by if URL will suffice. You can listen for a few events such as: payment_method.attached, setup_intent.succeeded. These provide you with the payment method ID (starts with pm) and the customer ID (starts with cus_).

woeful nymph
#

I meant URL in the checkout session.

#

can we send the URL in the checkout session to the customers so that they can add bank account?

#

or is there any else that we need to send?

void axle
#

Got it! Yes, you can just send the URL to the customet and they can provide their payment method details.

#

I would suggest creating a test Checkout Session and going through the flow. This will give you a better idea on how this works.

woeful nymph
#

yes, will do.
and for the webhook, will 'checkout.session.completed' be good?
this will get the 'SessionID' that I can use to retrieve the payment method and attach that to the Customer.

Is that right approach?

void axle
#

Yes checkout.session.completed is the correct event.

  • You can use the event to get the Checkout Session ID (cs) to retrieve the Checkout Session.
  • From there you can use the Setup Intent ID to retrieve the setup intent object (seti).
  • And then you can retrieve payment method object from the Setup Intent object.

https://docs.stripe.com/payments/checkout/save-and-reuse?payment-ui=stripe-hosted#retrieve-checkout-session โ†’ https://docs.stripe.com/payments/checkout/save-and-reuse?payment-ui=stripe-hosted

woeful nymph
#

thank you!
lastly, because this is done via email - what value should I add for the successURL & redirectURL?

void axle
#

I don't see a redirectURL. Are you referring to the return_url?

#

If yes, return_url can only be used if ui_mode is embedded or custom.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-return_url

For success_url you should pass a URL to which Stripe should send customers when payment or setup is complete.
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-return_url