lib/active_merchant/billing/gateways/epay.rb in jelaniharris-activemerchant-1.24.1 vs lib/active_merchant/billing/gateways/epay.rb in jelaniharris-activemerchant-1.29.1

- old
+ new

@@ -1,10 +1,10 @@ module ActiveMerchant #:nodoc: module Billing #:nodoc: class EpayGateway < Gateway API_HOST = 'ssl.ditonlinebetalingssystem.dk' - SOAP_URL = 'https://' + API_HOST + '/remote/payment' + self.live_url = 'https://' + API_HOST + '/remote/payment' self.default_currency = 'DKK' self.money_format = :cents self.supported_cardtypes = [:dankort, :forbrugsforeningen, :visa, :master, :american_express, :diners_club, :jcb, :maestro] @@ -52,11 +52,10 @@ # login: merchant number # password: referrer url (for authorize authentication) def initialize(options = {}) requires!(options, :login) - @options = options super end def authorize(money, credit_card_or_reference, options = {}) post = {} @@ -234,21 +233,21 @@ def make_headers(data, soap_call) { 'Content-Type' => 'text/xml; charset=utf-8', 'Host' => API_HOST, 'Content-Length' => data.size.to_s, - 'SOAPAction' => SOAP_URL + '/' + soap_call + 'SOAPAction' => self.live_url + '/' + soap_call } end def xml_builder(params, soap_call) xml = Builder::XmlMarkup.new(:indent => 2) xml.instruct! xml.tag! 'soap:Envelope', { 'xmlns:xsi' => 'http://schemas.xmlsoap.org/soap/envelope/', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', 'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/' } do xml.tag! 'soap:Body' do - xml.tag! soap_call, { 'xmlns' => SOAP_URL } do + xml.tag! soap_call, { 'xmlns' => self.live_url } do xml.tag! 'merchantnumber', @options[:login] xml.tag! 'transactionid', params[:transaction] xml.tag! 'amount', params[:amount].to_s if soap_call != 'delete' end end