Stripe Webhooks

Поделиться
HTML-код
  • Опубликовано: 15 окт 2019
  • Join us for our Developer Office Hours and get your questions about leveraging the awesome power of webhooks answered. CJ and Adrienne will walk you through how to setup an endpoint to accept webhook events reliably in Ruby. We'll cover some common tripping points, best practices, and using the CLI to test your endpoints.
    Table of Contents
    02:20 What is a Webhook?
    06:20 Demo of what we'll build
    07:00 Scaffold new Rails App
    09:00 Add simple Checkout UI
    13:10 Setup Webhook Route
    15:25 Skip CSRF Check
    16:00 Implement Webhook Controller Action
    20:00 Save and process events later
    26:07 Verify webhook signatures
    34:07 Refactor webhook handling into service objects
    39:14 Process events in background job
    46:03 Using ngrok
    53:22 Q&A
    Resources
    Official guides: stripe.com/docs/webhooks/build
    Stripe CLI: github.com/stripe/stripe-cli
    Code: github.com/stripe-samples/dev...
    Support
    If you have a question, please feel free to reach out to our support team on Discord at stripe.com/go/developer-chat.
    Updates
    Sign up to stay updated with developer news: go.stripe.global/dev-digest
    Feedback
    If you have any feedback about this or other episodes, let us know: forms.gle/VjNqzRhotM2snYo88.
    #Stripe #Payments
  • НаукаНаука

Комментарии • 30

  • @ambars5747
    @ambars5747 3 года назад +2

    Fantastic video. I was looking for a recommended approach to handle incoming duplicate Stripe webhook events. Storing events in a DB, indexed by event_id and then checking for a duplicate event by event_id is exactly what I needed to know. Thank you, immensely helpful!

  • @arturl5734
    @arturl5734 4 года назад

    this video was really helpful, thank you :)

  • @algorithmscasts902
    @algorithmscasts902 3 года назад

    very helpful, thank you

  • @smarquina1
    @smarquina1 4 года назад +12

    OK. I'm totally lost. I just want to put a simple embedded form using stripe elements... Where is the visual "For Dummies" guide?

  • @magenikofficial
    @magenikofficial 4 года назад

    watching the replay as it was 2 Am here when it was live

  • @sanjanaekbote1302
    @sanjanaekbote1302 4 года назад

    Thank you for the lovely video. I was wondering if we can select webhooks to trigger an external application by mentioning the endpoint of the external system in the dashboard?

  • @JoshuaTMagee
    @JoshuaTMagee 4 года назад

    Thank you for taking the time to walk through all of this! Is there any chance of getting this implementation code in vanilla PHP? For those of us who have never used Ruby on Rails, it's not immediately apparent how to capture all of these best practices in that language. Thank you!

  • @Gwibinjansagori
    @Gwibinjansagori 4 года назад

    Great lecture and very helpful understanding some best practices for dealing with web hooks in rails. I'm really struggling to understand why there is no mention of the Stripe Event gem for rails in this talk though. If I use the stripe event gem does it mean I can skip the part about validating signatures in the web hook controller? I'm really getting confused by this. Is this approach that you show in the video preferable to using the stripe event gem?

  • @timekeeperbank2761
    @timekeeperbank2761 3 года назад

    Ok, here is what everyone needs to know. Use the top section in the stripe admin panel for your web hooks so you can receive data.

  • @vivekkhairnar492
    @vivekkhairnar492 3 года назад

    can we pass multiple objects for a particular event type?

  • @malikasif3327
    @malikasif3327 3 года назад

    hello CJ
    how can i use stripe webhook for s2member plugin, em using custom forms not s2member pro forms. i've been searching it a lot couldn't find a way yet. please help

  • @davidpccode
    @davidpccode 4 года назад +1

    Hi CJ. That was awesome tks!! just a few questions: 1) Why do you log the endpoint response, in theory from the "sender" the only thing that need is the Http status. 2) What happend after retry the maximum times?, I assume the message is marked as failed, but will it keep in your database for ever? or after some days it'll delete? if so, will anyone know it was deleted? for example, before deleting, are they sent as an attachment in an email or something like that? ... Again thanks a lot

    • @StripeDev
      @StripeDev  4 года назад +1

      Great questions, David! \1 This was mostly just to demonstrate the return value, you can return an empty response body with a 200 status code if you'd like. \2 After a webhook is tried the maximum number of times and if the webhook endpoint has not had any successful deliveries the webhook endpoint will be disabled. The event will not be kept in our db forever. They are only available for a short time after. Hope that helps! Please feel free to reach out on IRC in the Freenode #stripe channel or support.stripe.com/contact for more info.

    • @davidpccode
      @davidpccode 4 года назад

      @@StripeDev Hello Stripe!! Very clear Thanks again.. Regards!!

  • @Oda3908
    @Oda3908 3 года назад +1

    holy molly I spend hours on the docs to figure out what the heck is a webhook and this lady just spent 3mins and everything is clear. Just wonder why you guys didn't paste those nice slides on your docs.

  • @KonKhmer83228
    @KonKhmer83228 2 года назад

    Vive la 🇫🇷 Adrienne Dreyfus

  • @fxstreamer238
    @fxstreamer238 2 года назад

    43:35 what is going on here? I dont know rails but its very strange that he is updating the state to "processed" after case argument. he expects to fail between the begin and end even though there is no error to catch. also why didnt the app respond 200 after raising the fail in a perfom_later function? before it had responded 200 immediately now how does it know that it will fail in the future?

  • @waqarmalik3257
    @waqarmalik3257 2 года назад

    i want this tutorial in nodejs plz

  • @afrolaff
    @afrolaff 4 года назад

    Why can't I save Stripe transaction id in database in flask ? Its really giving me night mare......

  • @cedricbiennais
    @cedricbiennais 4 года назад

    Thanks for this video, I understand a bit more what webhooks are!!
    But I'm still confused about how to set up a webhook as a newbie. I've read the documentation and I understood that after checkout is completed I must do not relie on the sucess url in checkout to deliver the product. stripe.com/docs/payments/checkout/fulfillment#webhooks
    I must use webhook instead, so my server can deliver the product when the webhook is sent to him. But could you make a video about what kind of code do you place and execute in your webhook referal page to deliver the product ??? What do we do to fufill the purchase (what is the code to send an e-mail, with the product...) ??? I'm a bit confused in this point...

    • @StripeDev
      @StripeDev  4 года назад +1

      Hey Cedric, each business is unique so the fulfillment logic is really dependent on what you're selling. If you want to reach out to support.stripe.com/contact we'd be more than happy to chat further on some of your options.

  • @RajYadav-yh7vv
    @RajYadav-yh7vv 4 года назад

    how to make use of this webhooks with the react application

  • @kenlaji
    @kenlaji 11 месяцев назад

    Stripe previously had a very simple and elegant way to trigger a test event - a simple button next to the URL that you set up on Stripe portal that would trigger a sample event. Why did Stripe remove this and introduce this long winded and frankly annoying CLI based implementation? We need to move out of 1990s!😄

  • @alpachino468
    @alpachino468 9 месяцев назад

    I bet the 13 downvotes are from PayPal employees...

  • @latinagunpowder
    @latinagunpowder 2 года назад

    Stripe they are responsible for my children food because they hold my legal money and they don't payout for me because of flimsy reasons, where is my money

  • @infoe-startupindia3361
    @infoe-startupindia3361 Год назад

    I have successfully retrieve the data from webhook using payment_intent.succeeded. However, not received stripe account id from payment_intent.succeeded event response.
    How can i identify for which stripe account, payment_intent.succeeded webhook response belongs?

    • @StripeDev
      @StripeDev  Год назад

      Hi there. The account ID is in the account field of the Event object when receiving an event for a Connected account on your endpoint: stripe.com/docs/connect/webhooks#connect-webhooks:~:text=should%20be%20taken.-,In,-addition.

    • @infoe-startupindia3361
      @infoe-startupindia3361 Год назад

      @@StripeDev Can't we obtain account id without connected account?

    • @StripeDev
      @StripeDev  Год назад

      Can you please clarify what you mean by that? Connect webhooks are for connected account activity, therefore linked to an account ID.