Class: OffsitePayments::Integrations::Paytm::Return
- Defined in:
- lib/offsite_payments/integrations/paytm.rb
Instance Attribute Summary
Attributes inherited from Return
Instance Method Summary collapse
-
#initialize(query_string, options = {}) ⇒ Return
constructor
A new instance of Return.
- #message ⇒ Object
- #status(order_id, order_amount) ⇒ Object
- #success? ⇒ Boolean
- #transaction_id ⇒ Object
Methods inherited from Return
Constructor Details
#initialize(query_string, options = {}) ⇒ Return
Returns a new instance of Return.
238 239 240 241 |
# File 'lib/offsite_payments/integrations/paytm.rb', line 238 def initialize(query_string, = {}) super @notification = Notification.new(query_string, ) end |
Instance Method Details
#message ⇒ Object
259 260 261 |
# File 'lib/offsite_payments/integrations/paytm.rb', line 259 def @notification. end |
#status(order_id, order_amount) ⇒ Object
247 248 249 250 251 252 253 |
# File 'lib/offsite_payments/integrations/paytm.rb', line 247 def status(order_id, order_amount) if @notification.invoice_ok?(order_id) && @notification.amount_ok?(BigDecimal(order_amount)) @notification.status else 'Mismatch' end end |
#success? ⇒ Boolean
255 256 257 |
# File 'lib/offsite_payments/integrations/paytm.rb', line 255 def success? status(@params['MERC_UNQ_REF'], @params['TXNAMOUNT']) == 'Completed' end |
#transaction_id ⇒ Object
243 244 245 |
# File 'lib/offsite_payments/integrations/paytm.rb', line 243 def transaction_id @notification.transaction_id end |