require 'httparty'
require 'builder'

class Datatrans::XML::Transaction
  class Request

    attr_accessor :params, :datatrans

    def post(url, options = {})
      options = options.merge(self.datatrans.proxy)
      HTTParty.post(url, options)
    end

    def initialize(datatrans, params)
      @datatrans = datatrans
      @params = params
    end

    def process
      raise 'overwrite in subclass!'
    end

    private

    include Datatrans::Common

    def build_xml_request(service)
      xml = Builder::XmlMarkup.new
      xml.instruct!
      xml.tag! "#{service}Service", :version => 1 do
        xml.body :merchantId => self.datatrans.merchant_id do |body|
          xml.transaction :refno => params[:refno] do
            xml.request do
              yield body
            end
          end
        end
      end
      xml.target!
    end
  end
end
require 'httparty'
require 'builder'

class Datatrans::XML::Transaction
  class Request

    attr_accessor :params, :datatrans

    def post(url, options = {})
      options = options.merge(self.datatrans.proxy)
      HTTParty.post(url, **options)
    end

    def initialize(datatrans, params)
      @datatrans = datatrans
      @params = params
    end

    def process
      raise 'overwrite in subclass!'
    end

    private

    include Datatrans::Common

    def build_xml_request(service)
      xml = Builder::XmlMarkup.new
      xml.instruct!
      xml.tag! "#{service}Service", :version => 1 do
        xml.body :merchantId => self.datatrans.merchant_id do |body|
          xml.transaction :refno => params[:refno] do
            xml.request do
              yield body
            end
          end
        end
      end
      xml.target!
    end
  end
end
Fix argument delegation in Ruby 3
Fix argument delegation in Ruby 3
