lib/active_merchant/billing/gateways/transbank_oneclick.rb
# Parse the incoming SOAP response.
Parse the incoming SOAP response.
Parse the incoming SOAP response .
def parse(xml, data)
        doc     = Nokogiri::XML.parse(xml)
        options = @options.merge(:test => test?)
        if valid_digest?(doc)
          params = body_to_params(doc)
          params['buyOrder'] ||= data[:order_id] if data.include?(:order_id)
          if params.include?('tbkUser')
            params['token'] = build_token(params['tbkUser'], data[:username])
          end
          TransbankOneclickResponse.new(params['success'], params['message'], params, options)
        else
          TransbankOneclickResponse.new(false, "Invalid response digest!")
        end
      end
def parse ( xml , data ) doc = Nokogiri :: XML . parse ( xml ) options = @options . merge ( :test => test? ) if valid_digest? ( doc ) params = body_to_params ( doc ) params [ 'buyOrder' ] ||= data [ :order_id ] if data . include? ( :order_id ) if params . include? ( 'tbkUser' ) params [ 'token' ] = build_token ( params [ 'tbkUser' ] , data [ :username ] ) end TransbankOneclickResponse . new ( params [ 'success' ] , params [ 'message' ] , params , options ) else TransbankOneclickResponse . new ( false , "Invalid response digest!" ) end end
Parse the incoming SOAP response.
Parse the incoming SOAP response .
# Make sure that the digest is okay # Manually add the order_id as it is not provided by the server # Build a usable token with the username
xml
data