Sha256: 95b4c7aa9a830460e3e6f0d5276063b62c3f49eb7e1a9b8ed937ff46b1ead770

Contents?: true

Size: 852 Bytes

Versions: 17

Compression:

Stored size: 852 Bytes

Contents

require "savon"
require "mundipagg/message"

module Mundipagg
  class Client
    def adapter
      @adapter ||= Savon.client do
        wsdl "https://transaction.mundipaggone.com/MundiPaggService.svc?wsdl"
        namespaces "xmlns:mun" => "http://schemas.datacontract.org/2004/07/MundiPagg.One.Service.DataContracts"
        log_level ::ActiveMerchant::Billing::Base.test? ? :debug : :error
        log true
      end
    end

    def call(operation, command, message)
      root = Mundipagg::Key.new(command, "tns").to_s
      message = Mundipagg::Message.new(message).translate

      adapter.call(operation, message: { root => message })
    end

    def manage_order(message)
      call :manage_order, :manage_order_request, message
    end

    def create_order(message)
      call :create_order, :create_order_request, message
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
better-mundipagg-0.2.11 lib/mundipagg/client.rb
better-mundipagg-0.2.10 lib/mundipagg/client.rb
better-mundipagg-0.2.9 lib/mundipagg/client.rb
better-mundipagg-0.2.8 lib/mundipagg/client.rb
better-mundipagg-0.2.7 lib/mundipagg/client.rb
better-mundipagg-0.2.6 lib/mundipagg/client.rb
better-mundipagg-0.2.5 lib/mundipagg/client.rb
better-mundipagg-0.2.4 lib/mundipagg/client.rb
better-mundipagg-0.2.3 lib/mundipagg/client.rb
better-mundipagg-0.2.2 lib/mundipagg/client.rb
better-mundipagg-0.2.1 lib/mundipagg/client.rb
better-mundipagg-0.2.0 lib/mundipagg/client.rb
better-mundipagg-0.1.5 lib/mundipagg/client.rb
better-mundipagg-0.1.3 lib/mundipagg/client.rb
better-mundipagg-0.1.2 lib/mundipagg/client.rb
better-mundipagg-0.1.1 lib/mundipagg/client.rb
better-mundipagg-0.1.0 lib/mundipagg/client.rb