lib/pay/stripe.rb in pay-2.7.0 vs lib/pay/stripe.rb in pay-2.7.1

- old
+ new

@@ -8,10 +8,12 @@ module Webhooks autoload :AccountUpdated, "pay/stripe/webhooks/account_updated" autoload :ChargeRefunded, "pay/stripe/webhooks/charge_refunded" autoload :ChargeSucceeded, "pay/stripe/webhooks/charge_succeeded" + autoload :CheckoutSessionCompleted, "pay/stripe/webhooks/checkout_session_completed" + autoload :CheckoutSessionAsyncPaymentSucceeded, "pay/stripe/webhooks/checkout_session_async_payment_succeeded" autoload :CustomerDeleted, "pay/stripe/webhooks/customer_deleted" autoload :CustomerUpdated, "pay/stripe/webhooks/customer_updated" autoload :PaymentActionRequired, "pay/stripe/webhooks/payment_action_required" autoload :PaymentIntentSucceeded, "pay/stripe/webhooks/payment_intent_succeeded" autoload :PaymentMethodUpdated, "pay/stripe/webhooks/payment_method_updated" @@ -84,9 +86,13 @@ events.subscribe "stripe.payment_method.card_automatically_updated", Pay::Stripe::Webhooks::PaymentMethodUpdated.new events.subscribe "stripe.payment_method.detached", Pay::Stripe::Webhooks::PaymentMethodUpdated.new # If an account is updated in stripe, we should update it as well events.subscribe "stripe.account.updated", Pay::Stripe::Webhooks::AccountUpdated.new + + # Handle subscriptions in Stripe Checkout Sessions + events.subscribe "stripe.checkout.session.completed", Pay::Stripe::Webhooks::CheckoutSessionCompleted.new + events.subscribe "stripe.checkout.session.async_payment_succeeded", Pay::Stripe::Webhooks::CheckoutSessionAsyncPaymentSucceeded.new end end end end