Class: Mundipagg::Client
- Inherits:
-
Object
- Object
- Mundipagg::Client
- Defined in:
- lib/mundipagg/client.rb
Instance Method Summary collapse
- #adapter ⇒ Object
- #call(operation, command, message) ⇒ Object
- #create_order(message) ⇒ Object
- #manage_order(message) ⇒ Object
Instance Method Details
#adapter ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/mundipagg/client.rb', line 6 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 |
#call(operation, command, message) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mundipagg/client.rb', line 15 def call(operation, command, ) root = Mundipagg::Key.new(command, "tns").to_s = Mundipagg::Message.new().translate adapter.call(operation, message: { root => }) end |
#create_order(message) ⇒ Object
26 27 28 |
# File 'lib/mundipagg/client.rb', line 26 def create_order() call :create_order, :create_order_request, end |
#manage_order(message) ⇒ Object
22 23 24 |
# File 'lib/mundipagg/client.rb', line 22 def manage_order() call :manage_order, :manage_order_request, end |