Method: Webmoney::RequestXML#xml_check_sign

Defined in:
lib/request_xml.rb

#xml_check_sign(opt) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/request_xml.rb', line 28

def xml_check_sign(opt)
  plan_out = @ic_out.iconv(opt[:plan])
  Nokogiri::XML::Builder.new( :encoding => 'windows-1251' ) { |x|
    x.send('w3s.request') {
      x.wmid @wmid
      x.testsign {
        x.wmid opt[:wmid]
        x.plan { x.cdata opt[:plan] }
        x.sign opt[:sign]
      }
      if classic?
        plan = @wmid + opt[:wmid] + plan_out + opt[:sign]
        x.sign sign(plan)
      end
    }
  }
end