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

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

Direct Known Subclasses

BitPay::Return, Bogus::Return, Chronopay::Return, Citrus::Return, DirecPay::Return, Directebanking::Return, Doku::Return, Dotpay::Return, Dwolla::Return, Gestpay::Return, HiTrust::Return, Ipay88::Return, Liqpay::Return, Nochex::Return, PayFast::Return, Paypal::Return, PayuIn::Return, Pxpay::Return, ActiveMerchant::Billing::Integrations::Robokassa::Return, SagePayForm::Return, TwoCheckout::Return, Valitor::Return, WirecardCheckoutPage::Return

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Return) initialize(query_string, options = {})



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

def initialize(query_string, options = {})
  @params  = parse(query_string)
  @options = options
end

Instance Attribute Details

- (Object) notification (readonly)

Returns the value of attribute notification



6
7
8
# File 'lib/active_merchant/billing/integrations/return.rb', line 6

def notification
  @notification
end

- (Object) params

Returns the value of attribute params



5
6
7
# File 'lib/active_merchant/billing/integrations/return.rb', line 5

def params
  @params
end

Instance Method Details

- (Boolean) cancelled?

Not cancelled by default. Overridden in the child class.



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

def cancelled?
  false
end

- (Object) message



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

def message
  
end

- (Object) parse(query_string)



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/active_merchant/billing/integrations/return.rb', line 27

def parse(query_string)
  return {} if query_string.blank?
  
  query_string.split('&').inject({}) do |memo, chunk|
    next if chunk.empty?
    key, value = chunk.split('=', 2)
    next if key.empty?
    value = value.nil? ? nil : CGI.unescape(value)
    memo[CGI.unescape(key)] = value
    memo
  end
end

- (Boolean) success?

Successful by default. Overridden in the child class



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

def success?
  true
end