Module: Adyen::Matchers

Defined in:
lib/adyen/matchers.rb

Defined Under Namespace

Modules: XPathPaymentFormCheck Classes: HaveAdyenPaymentForm

Instance Method Summary collapse

Instance Method Details

#assert_adyen_payment_form(subject, checks = {}) ⇒ Object



89
90
91
92
# File 'lib/adyen/matchers.rb', line 89

def assert_adyen_payment_form(subject, checks = {})
  default_checks = {:merchant_sig => :anything, :payment_amount => :anything, :currency_code => :anything, :skin_code => :anything }
  assert Adyen::Matchers::XPathPaymentFormCheck.check(subject, default_checks.merge(checks)), 'No Adyen payment form found'
end

#assert_adyen_recurring_payment_form(subject, checks = {}) ⇒ Object



94
95
96
97
# File 'lib/adyen/matchers.rb', line 94

def assert_adyen_recurring_payment_form(subject, checks = {})
  recurring_checks = { :recurring => true, :shopper_email => :anything, :shopper_reference => :anything }
  assert_adyen_payment_form(subject, recurring_checks.merge(checks))
end

#assert_adyen_single_payment_form(subject, checks = {}) ⇒ Object



99
100
101
102
# File 'lib/adyen/matchers.rb', line 99

def assert_adyen_single_payment_form(subject, checks = {})
  recurring_checks = { :recurring => false }
  assert_adyen_payment_form(subject, recurring_checks.merge(checks))
end

#have_adyen_payment_form(checks = {}) ⇒ Object



74
75
76
77
# File 'lib/adyen/matchers.rb', line 74

def have_adyen_payment_form(checks = {})
  default_checks = {:merchant_sig => :anything, :payment_amount => :anything, :currency_code => :anything, :skin_code => :anything }
  HaveAdyenPaymentForm.new(default_checks.merge(checks))
end

#have_adyen_recurring_payment_form(checks = {}) ⇒ Object



79
80
81
82
# File 'lib/adyen/matchers.rb', line 79

def have_adyen_recurring_payment_form(checks = {})
  recurring_checks = { :recurring => true, :shopper_email => :anything, :shopper_reference => :anything }
  have_adyen_payment_form(recurring_checks.merge(checks))
end

#have_adyen_single_payment_form(checks = {}) ⇒ Object



84
85
86
87
# File 'lib/adyen/matchers.rb', line 84

def have_adyen_single_payment_form(checks = {})
  recurring_checks = { :recurring => false }
  have_adyen_payment_form(recurring_checks.merge(checks))
end