Sha256: 538dbfbc1092c20b8863f402506438fe137b024f4c6f7a85ad6a287822cd72db
Contents?: true
Size: 691 Bytes
Versions: 5
Compression:
Stored size: 691 Bytes
Contents
class StripeModelCallbacks::Charge::DisputeUpdatedService < StripeModelCallbacks::BaseEventService def perform 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
5 entries across 5 versions & 1 rubygems