Sha256: 5455653a2b768d1342f9f0b355ca82e3a1e5a051f4b428fb6e37c311ca75289f
Contents?: true
Size: 655 Bytes
Versions: 11
Compression:
Stored size: 655 Bytes
Contents
module RefundMethods extend ActiveSupport::Concern included do class_attribute :eligible_refund_methods self.eligible_refund_methods = whitelisted_refund_methods.empty? ? defined_refund_methods : whitelisted_refund_methods end class_methods do def whitelisted_refund_methods # Override this methods to whitelist payment methods [] end def defined_refund_methods payment_methods = Spree::PaymentMethod.pluck(:type) sorted_payment_methods = payment_methods.reject { |payment_method| payment_method =~ /StoreCredit/ } (sorted_payment_methods | payment_methods).map(&:constantize) end end end
Version data entries
11 entries across 11 versions & 2 rubygems