Methods
Included Modules
Attributes
| [R] | event |
Class Public methods
events() Link
Source: show
# File app/lib/stripe/event_handlers/customer_subscription_updated.rb, line 9 def events ["customer.subscription.updated"] end
new(event) Link
Source: show
# File app/lib/stripe/event_handlers/customer_subscription_updated.rb, line 14 def initialize(event) @event = event end
Instance Public methods
call() Link
Source: show
# File app/lib/stripe/event_handlers/customer_subscription_updated.rb, line 18 def call return unless self.class.events.include?(event.type) && subscription.present? if incomplete_or_canceled? subscription.update_attribute(:pending_intent_id, nil) end if previously_incomplete? && subscription.incomplete_status? ::Api::AsyncIncompletePlanProvisionerJob .set(wait: 1.minute) .perform_later(event.id, event.try(:account)) end subscription.update_attribute(:status, new_status) if cancel_at_period_end? subscription.update_attribute(:cancels_on, subscription_cancels_on) else subscription.update_attribute(:cancels_on, nil) end if previous_status? ::EventBus.publish("member.updated", member:) end end