Warm tip: This article is reproduced from serverfault.com, please click

Would using a Stripe webhook work as a mechanism to have users pay to post content to a web app?

发布于 2020-12-06 01:00:12

I’m plotting out a new project (a job board) and would like to give users the ability to post a job listing for a fee. In thinking about the best way to achieve this, it seems like accepting payment from the user, then confirming payment with Stripe webhook, a POST request could be made back to the application which would post the desired job listing. Would this approach work? Apologies if this is an obvious solution. It’ll be my first time working with webhooks.

Questioner
Gaston
Viewed
0
floatingLomas 2020-12-07 11:05:01

Yes, that's probably the right way given the async nature of payments these days. Example with Checkout here: https://stripe.com/docs/payments/checkout/fulfill-orders but you could also use the payment_intent.succeeded event if you're using Elements and Payment Intents: https://stripe.com/docs/payments/accept-a-payment#web-fulfillment