8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/adyen/matchers.rb', line 8
def self.build_xpath_query(checks)
xpath_query = "//form[@id='adyen']"
recurring = checks.delete(:recurring)
unless recurring.nil?
if recurring
xpath_query << "[descendant::input[@type='hidden'][@name='recurringContract']]"
else
xpath_query << "[not(descendant::input[@type='hidden'][@name='recurringContract'])]"
end
end
checks.each do |key, value|
condition = "\n descendant::input[@type='hidden'][@name='#{Adyen::Util.camelize(key)}']"
condition << "[@value='#{value}']" unless value == :anything
xpath_query << "[#{condition}]"
end
return xpath_query
end
|