Sha256: 8c9217a4cc985844579322ae8e631e0ab881bbd786de810557a169b93e3659f3
Contents?: true
Size: 626 Bytes
Versions: 19
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: true module Spree module FlowIoCreditCardDecorator def self.prepended(base) base.serialize :meta, ActiveRecord::Coders::JSON.new(symbolize_keys: true) base.store_accessor :meta, :flow_data end def push_authorization(auth_hash) self.flow_data ||= {} flow_data['authorizations'] ||= [] card_authorizations = flow_data['authorizations'] card_authorizations.delete_if { |ca| ca['id'] == auth_hash['id'] } card_authorizations << auth_hash end Spree::CreditCard.prepend(self) if Spree::CreditCard.included_modules.exclude?(self) end end
Version data entries
19 entries across 19 versions & 1 rubygems