module Workarea module PayeezyGatewayVCRConfig def self.included(test) super test.setup :setup_gateway test.teardown :reset_gateway test.setup :setup_secrets test.teardown :reset_secrets end def setup_gateway @_old_gateway = Workarea.config.gateways.credit_card Workarea.config.gateways.credit_card = ActiveMerchant::Billing::PayeezyGateway.new( apikey: "78D9PJJDKnP52U1jwC4APpAsFdwxaphC", apisecret: "e75ec4c92dafb35e474bc6062b2daf85edb8af80212899e3f5b3da4d03e6919e", token: "fdoa-941fbaa7c83dd658684cfe1c31d6d61c941fbaa7c83dd658", test: true ) end def reset_gateway Workarea.config.gateways.credit_card = @_old_gateway end def setup_secrets @_old_secrets = Rails.application.secrets.payeezy Rails.application.secrets.payeezy = { ta_token: "NOIW" } end def reset_secrets Rails.application.secrets.payeezy = @_old_secrets end end end