Class: OffsitePayments::Return
- Inherits:
-
Object
- Object
- OffsitePayments::Return
- Defined in:
- lib/offsite_payments/return.rb
Direct Known Subclasses
Integrations::BitPay::Return, Integrations::Bogus::Return, Integrations::Chronopay::Return, Integrations::Citrus::Return, Integrations::Coinbase::Return, Integrations::DirecPay::Return, Integrations::Directebanking::Return, Integrations::Doku::Return, Integrations::Dotpay::Return, Integrations::Dwolla::Return, Integrations::Gestpay::Return, Integrations::HiTrust::Return, Integrations::Ipay88::Return, Integrations::Liqpay::Return, Integrations::MollieIdeal::Return, Integrations::MollieMistercash::Return, Integrations::Molpay::Return, Integrations::Nochex::Return, Integrations::PayFast::Return, Integrations::Paydollar::Return, Integrations::Paypal::Return, Integrations::Paytm::Return, Integrations::PayuIn::Return, Integrations::Pxpay::Return, Integrations::RealexOffsite::Return, Integrations::Robokassa::Return, Integrations::SagePayForm::Return, Integrations::TwoCheckout::Return, Integrations::Universal::Return, Integrations::Valitor::Return, Integrations::WirecardCheckoutPage::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
-
#cancelled? ⇒ Boolean
Not cancelled by default.
-
#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.
6 7 8 9 |
# File 'lib/offsite_payments/return.rb', line 6 def initialize(query_string, = {}) @params = parse(query_string) @options = end |
Instance Attribute Details
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
4 5 6 |
# File 'lib/offsite_payments/return.rb', line 4 def notification @notification end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/offsite_payments/return.rb', line 3 def params @params end |
Instance Method Details
#cancelled? ⇒ Boolean
Not cancelled by default. Overridden in the child class.
17 18 19 |
# File 'lib/offsite_payments/return.rb', line 17 def cancelled? false end |
#message ⇒ Object
21 22 |
# File 'lib/offsite_payments/return.rb', line 21 def end |
#parse(query_string) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/offsite_payments/return.rb', line 24 def parse(query_string) return {} if query_string.blank? query_string.split('&').inject({}) do |memo, chunk| next memo if chunk.empty? key, value = chunk.split('=', 2) next memo 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
12 13 14 |
# File 'lib/offsite_payments/return.rb', line 12 def success? true end |