{"id":8253,"date":"2019-12-04T10:58:32","date_gmt":"2019-12-04T10:58:32","guid":{"rendered":"https:\/\/www.botreetechnologies.com\/blog\/?p=8253"},"modified":"2021-08-06T17:51:16","modified_gmt":"2021-08-06T12:21:16","slug":"how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application","status":"publish","type":"post","link":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/","title":{"rendered":"Securely Handle Webook Events in Ruby on Rails App using Stripe"},"content":{"rendered":"\n<p><a href=\"https:\/\/stripe.com\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Stripe<\/a> is one of the most popular payment solutions and we use it at a large scale in many of <a href=\"https:\/\/www.botreetechnologies.com\/ruby-on-rails-development\" target=\"_blank\" rel=\"noopener noreferrer\">Ruby on Rails applications<\/a> we built to process payments. All such applications need to receive notifications about some important events from Stripe to perform some actions in workflows.<\/p>\n\n\n\n<p>Stripe can send <a href=\"https:\/\/stripe.com\/docs\/webhooks\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">webhook<\/a> events to notify the registered application about different events as they happen on exposed endpoints with HTTP POST requests. Because the endpoints(routes) are public, anybody can call it for malicious purposes. So it is really crucial to protect from harmful users.  <\/p>\n\n\n\n<p>Stripe webhook event sends <code>Stripe-Signature<\/code> header which can be used to verify authenticity to ensure request is coming from Stripe and not from a third party.<\/p>\n\n\n\n<p>The easiest way to do is by using<strong> \u2018stripe_events\u2019<\/strong> gem.<\/p>\n\n\n\n<p>Let\u2019s start with the implementation of Stripe webhooks. This is going to be very interesting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Installing Gem (Gemfile)<\/h3>\n\n\n\n<p>Add below Stripe gem to your gem file.<\/p>\n\n\n\n<p><code>gem 'stripe_event'<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.&nbsp; Adding Routes (routes.rb)<\/h3>\n\n\n\n<p><code>mount StripeEvent::Engine, at: '\/any-path-you-want'<\/code><\/p>\n\n\n\n<p>To make it cleaner we use the following path<\/p>\n\n\n\n<p><code>mount StripeEvent::Engine, at: '\/stripe\/webhook' # you can change this url<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3) Testing In The Development Environment<\/h3>\n\n\n\n<p>First of all for testing webhook locally we need to start the server on the <a href=\"https:\/\/ngrok.com\/download\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ngrok<\/a> as we all know it will create <strong>Publicly accessible URLs<\/strong>.<\/p>\n\n\n\n<p>Suppose my ngrok Rails URL is https:\/\/9123ab3f.ngrok.io\/<\/p>\n\n\n\n<p>then we need to add the endpoint for the webhook in a Stripe like https:\/\/9123ab3f.ngrok.io\/stripe\/webhook<\/p>\n\n\n\n<p>Now start setup for the Stripe Webhook.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Login to stripe account and go to the stripe dashboard.<\/li><li>Navigate to Developers &gt; Webhooks (<a href=\"https:\/\/dashboard.stripe.com\/webhooks\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">ref<\/a>).<\/li><li>Switch your account to test mode.<\/li><li>Add your <strong>EndPoint to Stripe webhook<\/strong> with the respective event which you want (e.g., creating charges or refunds or etc)<\/li><li>The EndPoint is your ngrok URL(e.g https:\/\/9123ab3f.ngrok.io\/stripe\/webhook)<\/li><\/ul>\n\n\n\n<p>For the LIVE mode, you need to add your website URL host in EndPoint.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Read more: <a href=\"https:\/\/www.botreetechnologies.com\/blog\/best-ruby-on-rails-projects-examples\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best Ruby on Rails projects Examples<\/a><\/strong><\/p><\/blockquote>\n\n\n\n<p>Once the webhook gets created, note the signing secret key for that webhook as we will need to add it to the code in the future.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook1.png\" alt=\"Handle Webhook Events\" class=\"wp-image-13381\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook1.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook1-300x148.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook1-768x378.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"510\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook-2.png\" alt=\"Handle Webhook Events From Stripe In Ruby On Rails\" class=\"wp-image-13382\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook-2.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook-2-300x149.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/webhook-2-768x383.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4) Adding Credentials (config\/initializers\/stripe.rb)<\/h3>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/MittalPatel-BTC\/62700954d81a9c67dadabcb3a0031a77.js\"><\/script><\/p>\n\n\n\n<p>In this we have configured one stripe event which is <strong>&#8216;charge.dispute.created&#8217; &amp; Stripe::EventHandler<\/strong> is one service which we created to handle the after effect when webhook called.<\/p>\n\n\n\n<p>When any charge gets created for stripe payment it will call the <strong>Stripe::EventHandler<\/strong> class.<\/p>\n\n\n\n<p>You can also define the multiple events in <strong>StripeEvent.configure<\/strong> block.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Read More: <a href=\"https:\/\/www.botreetechnologies.com\/blog\/handling-bigcommerce-webhooks-with-rails-application\" target=\"_blank\" rel=\"noopener noreferrer\">Handling BigCommerce Webhooks in Ruby on Rails application<\/a><\/p><\/blockquote>\n\n\n\n<p>For handling all events of the charge like<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Charge Created<\/li><li>Charge Updated<\/li><li>Charge Closed<\/li><li>Charge Funds Reinstated<\/li><li>Charge Funds Withdrawn<\/li><\/ol>\n\n\n\n<p><strong>Just use \u2018charge.dispute.\u2019&nbsp;<\/strong><\/p>\n\n\n\n<p>events.subscribe &#8216;charge.dispute.&#8217;, Stripe::EventHandler.new<\/p>\n\n\n\n<p>This will tell instruct stripe when any \u2018charge.dispute.\u2019 event gets fired just redirect to an endpoint and call <strong>Stripe::EventHandler<\/strong> class.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5) Service for handling webhook request<\/h3>\n\n\n\n<p>Create one service says <strong>event_handler.rb<\/strong> under the <strong>services\/stripe<\/strong> folder <strong>(app\/services\/stripe\/event_handler.rb)<\/strong>.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/MittalPatel-BTC\/b6fd1315e04b7320c470b061d3185194.js\"><\/script><\/p>\n\n\n\n<p>You can also define service based on the stripe events that way you can use the inheritance concept and make your code simple.<\/p>\n\n\n\n<p><strong>Suppose we have to handle two Stripe events<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Charge dispute<\/li><li>Charge refund<\/li><\/ul>\n\n\n\n<p>You can define service like below and you can separate code.<\/p>\n\n\n\n<p>Main service(EventHandler) which handles the request.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/MittalPatel-BTC\/a33563b92c0b93bd70bf042cba2984fa.js\"><\/script><\/p>\n\n\n\n<p>This service will handle the charge dispute events accordingly request.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/MittalPatel-BTC\/7061f19f5d7d140b67522870581b9130.js\"><\/script><\/p>\n\n\n\n<p>This service will handle the charge refund events accordingly request.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/MittalPatel-BTC\/dbe63c31af4a87c470299521865a2cff.js\"><\/script><\/p>\n\n\n\n<p>Interesting right! We would highly encourage you to consider securing your Stripe webhooks. Stripe webhooks with a Ruby on Rails application development company.<\/p>\n\n\n\n<p>Thanks for reading!<\/p>\n\n\n\n<p><a href=\"https:\/\/www.botreetechnologies.com\/ruby-on-rails-development\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Click here for more details&#8230;<\/strong><\/a><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.botreetechnologies.com\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">Consulting is free<\/a> &#8211; let us help you grow!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stripe is one of the most popular payment solutions and&#8230;<\/p>\n","protected":false},"author":43,"featured_media":13379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,10],"tags":[],"class_list":["post-8253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-on-rails","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?<\/title>\n<meta name=\"description\" content=\"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?\" \/>\n<meta property=\"og:description\" content=\"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\" \/>\n<meta property=\"og:site_name\" content=\"BoTree Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BoTreeTechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-04T10:58:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-06T12:21:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"683\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mittal Patel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:site\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mittal Patel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\"},\"author\":{\"name\":\"Mittal Patel\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d\"},\"headline\":\"Securely Handle Webook Events in Ruby on Rails App using Stripe\",\"datePublished\":\"2019-12-04T10:58:32+00:00\",\"dateModified\":\"2021-08-06T12:21:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\"},\"wordCount\":620,\"commentCount\":10,\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg\",\"articleSection\":[\"Ruby on Rails\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\",\"name\":\"How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg\",\"datePublished\":\"2019-12-04T10:58:32+00:00\",\"dateModified\":\"2021-08-06T12:21:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d\"},\"description\":\"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg\",\"width\":1024,\"height\":683,\"caption\":\"Ruby on Rails Application\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.botreetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Securely Handle Webook Events in Ruby on Rails App using Stripe\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/\",\"name\":\"BoTree Technologies\",\"description\":\"Committed to inspire generation.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d\",\"name\":\"Mittal Patel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png\",\"caption\":\"Mittal Patel\"},\"description\":\"Mittal is a Ruby on Rails Developer. She loves Ruby &amp; Javascript. Also, she loves to solve problems and taking ownership of her work. Apart from coding, she likes to listen to songs, eating desserts and cooking.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?","description":"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/","og_locale":"en_US","og_type":"article","og_title":"How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?","og_description":"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.","og_url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/","og_site_name":"BoTree Technologies","article_publisher":"https:\/\/www.facebook.com\/BoTreeTechnologies\/","article_published_time":"2019-12-04T10:58:32+00:00","article_modified_time":"2021-08-06T12:21:16+00:00","og_image":[{"width":1024,"height":683,"url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg","type":"image\/jpeg"}],"author":"Mittal Patel","twitter_card":"summary_large_image","twitter_creator":"@BoTreeTech","twitter_site":"@BoTreeTech","twitter_misc":{"Written by":"Mittal Patel","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#article","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/"},"author":{"name":"Mittal Patel","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d"},"headline":"Securely Handle Webook Events in Ruby on Rails App using Stripe","datePublished":"2019-12-04T10:58:32+00:00","dateModified":"2021-08-06T12:21:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/"},"wordCount":620,"commentCount":10,"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg","articleSection":["Ruby on Rails","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/","url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/","name":"How To Securely Handle Webhook Events From Stripe In Ruby On Rails Application?","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage"},"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg","datePublished":"2019-12-04T10:58:32+00:00","dateModified":"2021-08-06T12:21:16+00:00","author":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d"},"description":"Handling webhook events from Stripe can be a challenge. We outline the steps to send webhook events to notify the registered web application about different events.","breadcrumb":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#primaryimage","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/webhook-events-from-stripe.jpg","width":1024,"height":683,"caption":"Ruby on Rails Application"},{"@type":"BreadcrumbList","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-securely-handle-webhook-events-from-stripe-in-ruby-on-rails-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.botreetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Securely Handle Webook Events in Ruby on Rails App using Stripe"}]},{"@type":"WebSite","@id":"https:\/\/www.botreetechnologies.com\/blog\/#website","url":"https:\/\/www.botreetechnologies.com\/blog\/","name":"BoTree Technologies","description":"Committed to inspire generation.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/e1398e9b330d623c88987fcf781b8a6d","name":"Mittal Patel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/mittal-patel-150x150.png","caption":"Mittal Patel"},"description":"Mittal is a Ruby on Rails Developer. She loves Ruby &amp; Javascript. Also, she loves to solve problems and taking ownership of her work. Apart from coding, she likes to listen to songs, eating desserts and cooking."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=8253"}],"version-history":[{"count":4,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8253\/revisions"}],"predecessor-version":[{"id":16069,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8253\/revisions\/16069"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media\/13379"}],"wp:attachment":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=8253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=8253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=8253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}