#mmv-checkout

1 messages · Page 1 of 1 (latest)

winged socket
#

hi! well generally if you have different businesses you have different Stripe accounts. Or you use Connect such that your platform recieves events from connected accounts and there's an account field we provide. (https://stripe.com/docs/connect/webhooks#connect-webhooks)

There's no way to do what you specifically ask(set the webhook URL dynamically)
Really the options here are just

  • when setting up the webhook URL, do something like http://myserver.com/webhook?store=storeA with a query parameter to differenciate
  • use Connect
stone dirge
#

Hi, thank you for your reply. We are one business, but we have multiple websites up and running at the same time, each for a specific event.

We are already using Connect, as we are building a marketplace. When we receive a payment_intent.successful event, we want to fulfill that order, by notifying all relevant parties, and transferring funds to Connected account involved in the transaction.

I would be very surprised if Stripe can only notify the server back via one static URL. Other payment providers have options to solve this, such as the NotificationUrl on Cybersource, that can be set with every Checkout Session

winged socket
#

I would be very surprised if Stripe can only notify the server back via one static URL
I suppose you'll be surprised then!

The way it works is your account can have multiple webhook URLs configured(up to 16), and you can have multiple endpoints set up to listen to the same type of event. They're configured statically in your dashboard ahead of time.

#

if you're using Connect for Destination charges/Separate Charges & Transfers(i.e. you charge on the platform and transfer funds to the connected account as you mention) then yeah, all the payment_intent.* and checkout.session.completed events go to your platform endpoints and not a Connect endpoint and don't include the account field directly

#

you could add metadata to the CheckoutSession objects when you create them , and look for that metadata in the webhook handler. That is likely the solution here(it's closest to what you're asking for in setting the notification URL dynamically; you can instead set metadata dynamically and check for it in the static webhook handler to know what accounts are involved).
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata