From 9eaefa75a700a39010c3381329fb3a275f4eb92a Mon Sep 17 00:00:00 2001 From: 4nd2in Date: Sun, 14 Jul 2024 13:21:28 +0200 Subject: [PATCH 1/3] Fix: replace deprecated Request#[] with request.params[] (applies for rack version >= 3.1) --- app/models/stripe/event_dispatch.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/stripe/event_dispatch.rb b/app/models/stripe/event_dispatch.rb index f83b4c42..fba3ea7f 100644 --- a/app/models/stripe/event_dispatch.rb +++ b/app/models/stripe/event_dispatch.rb @@ -8,7 +8,7 @@ def dispatch_stripe_event(request) end def retrieve_stripe_event(request) - id = request['id'] + id = request.params[:id] body = request.body.read sig_header = request.headers['HTTP_STRIPE_SIGNATURE'] endpoint_secrets = ::Rails.application.config.stripe.signing_secrets From 6794a614e47883d92d35e5299b3638309983fc7e Mon Sep 17 00:00:00 2001 From: 4nd2in Date: Sun, 14 Jul 2024 13:34:53 +0200 Subject: [PATCH 2/3] Feature: add missing stripe event callbacks for checkout, customer and invoice --- lib/stripe/callbacks.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/stripe/callbacks.rb b/lib/stripe/callbacks.rb index 3f74d590..20e11d2b 100644 --- a/lib/stripe/callbacks.rb +++ b/lib/stripe/callbacks.rb @@ -25,6 +25,8 @@ module Callbacks callback 'charge.dispute.funds_withdrawn' callback 'charge.dispute.updated' callback 'charge.refund.updated' + callback 'checkout.session.async_payment_failed' + callback 'checkout.session.async_payment_succeeded' callback 'checkout.session.completed' callback 'checkout.session.expired' callback 'coupon.created' @@ -42,12 +44,19 @@ module Callbacks callback 'customer.source.updated' callback 'customer.subscription.created' callback 'customer.subscription.deleted' + callback 'customer.subscription.paused' + callback 'customer.subscription.pending_update_applied' + callback 'customer.subscription.pending_update_expired' + callback 'customer.subscription.resumed' callback 'customer.subscription.trial_will_end' callback 'customer.subscription.updated' callback 'file.created' callback 'invoice.created' + callback 'invoice.deleted' + callback 'invoice.finalization_failed' callback 'invoice.finalized' callback 'invoice.marked_uncollectible' + callback 'invoice.overdue' callback 'invoice.paid' callback 'invoice.payment_action_required' callback 'invoice.payment_failed' @@ -56,6 +65,7 @@ module Callbacks callback 'invoice.upcoming' callback 'invoice.updated' callback 'invoice.voided' + callback 'invoice.will_be_due' callback 'invoiceitem.created' callback 'invoiceitem.deleted' callback 'invoiceitem.updated' From 03de70a3b53ab16c3853e6fc3710dac0574bb567 Mon Sep 17 00:00:00 2001 From: 4nd2in Date: Sun, 14 Jul 2024 14:04:32 +0200 Subject: [PATCH 3/3] update changelog --- Changelog.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7fa90ed4..feec55b6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,17 @@ +## 2.5.1 (2024-07-14) +- Add the following callbacks (Thanks @4nd2in !): + * `checkout.session.async_payment_failed` + * `checkout.session.async_payment_succeeded` + * `customer.subscription.paused` + * `customer.subscription.pending_update_applied` + * `customer.subscription.pending_update_expired` + * `customer.subscription.resumed` + * `invoice.deleted` + * `invoice.finalization_failed` + * `invoice.overdue` + * `invoice.will_be_due` +- Fix request handling in rack versions >= 3.1 where `Request#[]` is deprecated (#230). Thanks @4nd2in ! + ## 2.5.0 (2023-03-21) - Allow `stripe_elements_tag` to accept a block. Thanks @chip !