Class: ActiveMerchant::Billing::Integrations::Payline::WebPaymentRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/active_merchant_payline/integration/lib/web_payment_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ WebPaymentRequest

Returns a new instance of WebPaymentRequest.



9
10
11
# File 'lib/active_merchant_payline/integration/lib/web_payment_request.rb', line 9

def initialize(options = {})
  self.options= options
end

Instance Attribute Details

#optionsObject

merchant_id, merchant_key, contract, return_url, amount



7
8
9
# File 'lib/active_merchant_payline/integration/lib/web_payment_request.rb', line 7

def options
  @options
end

Instance Method Details

#to_xmlObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/active_merchant_payline/integration/lib/web_payment_request.rb', line 13

def to_xml
  xml= Builder::XmlMarkup.new
  xml.instruct!
  xmlns= { 
    'xmlns:soapenv' => 'http://schemas.xmlsoap.org/soap/envelope/',
    'xmlns:impl' => 'http://impl.ws.payline.experian.com',
    'xmlns:obj' => 'http://obj.ws.payline.experian.com'
  }
  
  xml.soapenv :Envelope, xmlns do 
    xml.soapenv :Header do
    end
    xml.soapenv :Body do
      do_web_payment_envelope xml
    end
  end

  xml.target!
end