Skip to content

Instantly share code, notes, and snippets.

@aaronlifton
Created May 2, 2017 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronlifton/9615019f69775fd2006e9e3f6b19c150 to your computer and use it in GitHub Desktop.
Save aaronlifton/9615019f69775fd2006e9e3f6b19c150 to your computer and use it in GitHub Desktop.
extending spree original payment reimbursement type
module Spree::ReimbursementType::ExtendedOriginalPayment
def self.included(base)
class << base
include ClassMethods
end
end
module ClassMethods
def reimburse(reimbursement, return_items, simulate)
if simulate
super
else
# do something
super
end
end
end
end
# original_payment_decorator.rb
class Spree::ReimbursementType::OriginalPayment
include Spree::ReimbursementType::ExtendedOriginalPayment
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment