Sha256: 4fd0771bcf7a4d3180df5c82ca7a4d2aeea1a47a70d7580fcd1e00850c70449f
Contents?: true
Size: 691 Bytes
Versions: 3
Compression:
Stored size: 691 Bytes
Contents
class StripeModelCallbacks::Charge::DisputeUpdatedService < StripeModelCallbacks::BaseEventService def execute dispute.assign_from_stripe(object) if dispute.save create_activity succeed! else fail! dispute.errors.full_messages end end private def dispute @dispute ||= StripeDispute.find_or_initialize_by(stripe_id: object.id) end def create_activity case event.type when "charge.dispute.closed" dispute.create_activity :closed when "charge.dispute.funds_reinstated" dispute.create_activity :funds_reinstated when "charge.dispute.funds_withdrawn" dispute.create_activity :funds_withdrawn end end end
Version data entries
3 entries across 3 versions & 1 rubygems