Class: ActiveMerchant::Billing::Integrations::WirecardCheckoutPage::Return

Inherits:
Return
  • Object
show all
Includes:
Common
Defined in:
lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb

Instance Attribute Summary

Attributes inherited from Return

#notification, #params

Instance Method Summary collapse

Methods included from Common

#message, #verify_response

Methods inherited from Return

#message, #parse

Constructor Details

#initialize(postdata, options = {}) ⇒ Return

Returns a new instance of Return.



8
9
10
11
12
# File 'lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb', line 8

def initialize(postdata, options = {})
  @params  = parse(postdata)
  @options = options
  verify_response(@params, options[:secret])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_id, *args) ⇒ Object



26
27
28
# File 'lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb', line 26

def method_missing(method_id, *args)
  return params[method_id.to_s] if params.has_key?(method_id.to_s)
end

Instance Method Details

#cancelled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb', line 18

def cancelled?
  @paymentstate == 'CANCEL'
end

#pending?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb', line 22

def pending?
  @paymentstate == 'PENDING'
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/active_merchant/billing/integrations/wirecard_checkout_page/return.rb', line 14

def success?
  @paymentstate == 'SUCCESS'
end