{"id":13463204,"url":"https://github.com/integrallis/stripe_event","last_synced_at":"2026-05-20T22:00:42.768Z","repository":{"id":3687605,"uuid":"4757857","full_name":"integrallis/stripe_event","owner":"integrallis","description":"Stripe webhook integration for Rails applications.","archived":false,"fork":false,"pushed_at":"2026-04-19T00:33:17.000Z","size":502,"stargazers_count":855,"open_issues_count":18,"forks_count":105,"subscribers_count":21,"default_branch":"master","last_synced_at":"2026-05-07T16:07:16.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/stripe_event","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/integrallis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-06-23T02:07:47.000Z","updated_at":"2026-04-28T08:31:12.000Z","dependencies_parsed_at":"2024-01-13T03:01:16.331Z","dependency_job_id":"cae5aeb5-2d88-4684-a5c9-860fc062cbea","html_url":"https://github.com/integrallis/stripe_event","commit_stats":{"total_commits":331,"total_committers":32,"mean_commits":10.34375,"dds":0.5800604229607251,"last_synced_commit":"8c48a88424918c3e0ccbef7aa6159b21feeb1161"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/integrallis/stripe_event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrallis%2Fstripe_event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrallis%2Fstripe_event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrallis%2Fstripe_event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrallis%2Fstripe_event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/integrallis","download_url":"https://codeload.github.com/integrallis/stripe_event/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/integrallis%2Fstripe_event/sbom","scorecard":{"id":490253,"data":{"date":"2025-08-11","repo":{"name":"github.com/integrallis/stripe_event","commit":"70fefc88c41d9bbd97cbfa88f892a098f0f35b56"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 6/21 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/integrallis/stripe_event/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/integrallis/stripe_event/ci.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T18:56:32.848Z","repository_id":3687605,"created_at":"2025-08-19T18:56:32.848Z","updated_at":"2025-08-19T18:56:32.848Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33136088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:48.012Z","updated_at":"2026-05-20T22:00:42.760Z","avatar_url":"https://github.com/integrallis.png","language":"Ruby","funding_links":[],"categories":["E-Commerce and Payments","Ruby","API Clients \u0026 SDKs"],"sub_categories":["Payments","Third-Party Integrations"],"readme":"# StripeEvent\n\n[![Build Status](https://github.com/integrallis/stripe_event/workflows/CI/badge.svg)](https://github.com/integrallis/stripe_event/actions?query=workflow%3ACI)\n[![Gem Version](https://badge.fury.io/rb/stripe_event.svg)](http://badge.fury.io/rb/stripe_event)\n[![Gem Downloads](https://img.shields.io/gem/dt/stripe_event.svg)](https://rubygems.org/gems/stripe_event)\n\nStripeEvent is built on the [ActiveSupport::Notifications API](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html). Incoming webhook requests are [authenticated with the webhook signature](#authenticating-webhooks-with-signatures). Define subscribers to handle specific event types. Subscribers can be a block or an object that responds to `#call`.\n\n## Install\n\n```ruby\n# Gemfile\ngem 'stripe_event'\n```\n\n```ruby\n# config/routes.rb\nmount StripeEvent::Engine, at: '/my-chosen-path' # provide a custom path\n```\n\n## Usage\n\n```ruby\n# config/initializers/stripe.rb\nStripe.api_key             = ENV['STRIPE_SECRET_KEY']     # e.g. sk_live_...\nStripeEvent.signing_secret = ENV['STRIPE_SIGNING_SECRET'] # e.g. whsec_...\n\nStripeEvent.configure do |events|\n  events.subscribe 'charge.failed' do |event|\n    # Define subscriber behavior based on the event object\n    event.class       #=\u003e Stripe::Event\n    event.type        #=\u003e \"charge.failed\"\n    event.data.object #=\u003e #\u003cStripe::Charge:0x3fcb34c115f8\u003e\n  end\n\n  events.all do |event|\n    # Handle all event types - logging, etc.\n  end\nend\n```\n\n### Subscriber objects that respond to #call\n\n```ruby\nclass CustomerCreated\n  def call(event)\n    # Event handling\n  end\nend\n\nclass BillingEventLogger\n  def initialize(logger)\n    @logger = logger\n  end\n\n  def call(event)\n    @logger.info \"BILLING:#{event.type}:#{event.id}\"\n  end\nend\n```\n\n```ruby\nStripeEvent.configure do |events|\n  events.all BillingEventLogger.new(Rails.logger)\n  events.subscribe 'customer.created', CustomerCreated.new\nend\n```\n\n### Subscribing to a namespace of event types\n\n```ruby\nStripeEvent.subscribe 'customer.card.' do |event|\n  # Will be triggered for any customer.card.* events\nend\n```\n\n## Securing your webhook endpoint\n\n### Authenticating webhooks with signatures\n\nStripe will cryptographically sign webhook payloads with a signature that is included in a special header sent with the request. Verifying this signature lets your application properly authenticate the request originated from Stripe. **As of [v2.0.0](https://github.com/integrallis/stripe_event/releases/tag/v2.0.0), StripeEvent now mandates that this feature be used**. Please set the `signing_secret` configuration value:\n\n```ruby\nStripeEvent.signing_secret = Rails.application.secrets.stripe_signing_secret\n```\n\nPlease refer to Stripe's documentation for more details: https://stripe.com/docs/webhooks#signatures\n\n### Support for multiple signing secrets\n\nSometimes, you'll have multiple Stripe webhook subscriptions pointing at your application each with a different signing secret. For example, you might have both a main Account webhook and a webhook for a Connect application point at the same endpoint. It's possible to configure an array of signing secrets using the `signing_secrets` configuration option. The first one that successfully matches for each incoming webhook will be used to verify your incoming events.\n\n```ruby\nStripeEvent.signing_secrets = [\n  Rails.application.secrets.stripe_account_signing_secret,\n  Rails.application.secrets.stripe_connect_signing_secret,\n]\n```\n\n(NOTE: `signing_secret=` and `signing_secrets=` are just aliases for one another)\n\n## Configuration\n\nIf you have built an application that has multiple Stripe accounts--say, each of your customers has their own--you may want to define your own way of retrieving events from Stripe (e.g. perhaps you want to use the [account parameter](https://stripe.com/docs/connect/webhooks) from the top level to detect the customer for the event, then grab their specific API key). You can do this:\n\n```ruby\nclass EventFilter\n  def call(event)\n    event.api_key = lookup_api_key(event.account)\n    event\n  end\n\n  def lookup_api_key(account_id)\n    Account.find_by!(stripe_account_id: account_id).api_key\n  rescue ActiveRecord::RecordNotFound\n    # whoops something went wrong - error handling\n  end\nend\n\nStripeEvent.event_filter = EventFilter.new\n```\n\nIf you'd like to ignore particular webhook events (perhaps to ignore test webhooks in production, or to ignore webhooks for a non-paying customer), you can do so by returning `nil` in your custom `event_filter`. For example:\n\n```ruby\nStripeEvent.event_filter = lambda do |event|\n  return nil if Rails.env.production? \u0026\u0026 !event.livemode\n  event\nend\n```\n\n```ruby\nStripeEvent.event_filter = lambda do |event|\n  account = Account.find_by!(stripe_account_id: event.account)\n  return nil if account.delinquent?\n  event\nend\n```\n\n*Note: Older versions of Stripe used `event.user_id` to reference the Connect Account ID.*\n\n## Without Rails\n\nStripeEvent can be used outside of Rails applications as well. Here is a basic Sinatra implementation:\n\n```ruby\nrequire 'json'\nrequire 'sinatra'\nrequire 'stripe_event'\n\nStripe.api_key = ENV['STRIPE_SECRET_KEY']\n\nStripeEvent.subscribe 'charge.failed' do |event|\n  # Look ma, no Rails!\nend\n\npost '/_billing_events' do\n  data = JSON.parse(request.body.read, symbolize_names: true)\n  StripeEvent.instrument(data)\n  200\nend\n```\n\n## Testing\n\nHandling webhooks is a critical piece of modern billing systems. Verifying the behavior of StripeEvent subscribers can be done fairly easily by stubbing out the HTTP signature header used to authenticate the webhook request. Tools like [Webmock](https://github.com/bblimke/webmock) and [VCR](https://github.com/vcr/vcr) work well. [RequestBin](https://requestbin.com/) is great for collecting the payloads. For exploratory phases of development, [UltraHook](http://www.ultrahook.com/) and other tools can forward webhook requests directly to localhost. You can check out [test-hooks](https://github.com/invisiblefunnel/test-hooks), an example Rails application to see how to test StripeEvent subscribers with RSpec request specs and Webmock. A quick look:\n\n```ruby\n# spec/requests/billing_events_spec.rb\nrequire 'rails_helper'\n\ndescribe \"Billing Events\" do\n  def bypass_event_signature(payload)\n    event = Stripe::Event.construct_from(JSON.parse(payload, symbolize_names: true))\n    expect(Stripe::Webhook).to receive(:construct_event).and_return(event)\n  end\n\n  describe \"customer.created\" do\n    let(:payload) { file_fixture('evt_customer_created.json').read }\n    before(:each) { bypass_event_signature(payload) }\n\n    it \"is successful\" do\n      post '/_billing_events', params: payload\n      expect(response).to have_http_status(:success)\n      # Additional expectations...\n    end\n  end\nend\n```\n\n### Maintainers\n\n* [Ryan McGeary](https://github.com/rmm5t)\n* [Pete Keen](https://github.com/peterkeen)\n* [Danny Whalen](https://github.com/invisiblefunnel)\n\nSpecial thanks to all the [contributors](https://github.com/integrallis/stripe_event/graphs/contributors).\n\n### Versioning\n\nSemantic Versioning 2.0 as defined at \u003chttp://semver.org\u003e.\n\n### License\n\n[MIT License](https://github.com/integrallis/stripe_event/blob/master/LICENSE.md). Copyright 2012-2015 Integrallis Software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegrallis%2Fstripe_event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegrallis%2Fstripe_event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegrallis%2Fstripe_event/lists"}