Sha256: a2c9f339b7b7bad772eeb7841b92bc25705b4b6c35afbd3f21f4b6951fcf0e4f
Contents?: true
Size: 919 Bytes
Versions: 2
Compression:
Stored size: 919 Bytes
Contents
module Spree class Gateway::AuthorizeNet < Gateway preference :login, :string preference :password, :string def provider_class ActiveMerchant::Billing::AuthorizeNetGateway end def options super().merge(test: self.preferred_test_mode) end def credit(amount, response_code, refund, gateway_options = {}) gateway_options[:card_number] = refund[:originator].payment.source.last_digits auth_net_gateway.refund(amount, response_code, gateway_options) end private def auth_net_gateway @_auth_net_gateway ||= begin ActiveMerchant::Billing::Base.gateway_mode = preferred_server.to_sym gateway_options = options gateway_options[:test_requests] = false # DD: never ever do test requests because just returns transaction_id = 0 ActiveMerchant::Billing::AuthorizeNetGateway.new(gateway_options) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solidus_gateway-1.3.0 | app/models/spree/gateway/authorize_net.rb |
solidus_gateway-1.2.0 | app/models/spree/gateway/authorize_net.rb |