Class: ActiveMerchant::Billing::Integrations::Return
- Inherits:
-
Object
- Object
- ActiveMerchant::Billing::Integrations::Return
- Defined in:
- lib/active_merchant/billing/integrations/return.rb
Direct Known Subclasses
Bogus::Return, Chronopay::Return, DirecPay::Return, Gestpay::Return, HiTrust::Return, Nochex::Return, Paypal::Return, SagePayForm::Return, TwoCheckout::Return
Instance Attribute Summary collapse
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(query_string, options = {}) ⇒ Return
constructor
A new instance of Return.
- #message ⇒ Object
- #parse(query_string) ⇒ Object
-
#success? ⇒ Boolean
Successful by default.
Constructor Details
#initialize(query_string, options = {}) ⇒ Return
Returns a new instance of Return.
8 9 10 11 |
# File 'lib/active_merchant/billing/integrations/return.rb', line 8 def initialize(query_string, = {}) @params = parse(query_string) @options = end |
Instance Attribute Details
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
6 7 8 |
# File 'lib/active_merchant/billing/integrations/return.rb', line 6 def notification @notification end |
#params ⇒ Object
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
#message ⇒ Object
18 19 20 |
# File 'lib/active_merchant/billing/integrations/return.rb', line 18 def end |
#parse(query_string) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/active_merchant/billing/integrations/return.rb', line 22 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 |
#success? ⇒ Boolean
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 |