lib/active_merchant/billing/integrations/payu_in/notification.rb in activemerchant-1.36.0 vs lib/active_merchant/billing/integrations/payu_in/notification.rb in activemerchant-1.37.0
- old
+ new
@@ -9,27 +9,25 @@
@merchant_id = options[:credential1]
@secret_key = options[:credential2]
end
def complete?
- status == "success"
+ status == "Completed"
end
- # Status of the transaction. List of possible values:
- # <tt>invalid</tt>:: transaction id is not present
- # <tt>tampered</tt>:: transaction data has been tampered
- # <tt>success</tt>:: transaction successful
- # <tt>pending</tt>:: transaction is pending for some approval
- # <tt>failure</tt>:: transaction failure
def status
@status ||= if checksum_ok?
if transaction_id.blank?
- 'invalid'
+ 'Invalid'
else
- transaction_status.downcase
+ case transaction_status.downcase
+ when 'success' then 'Completed'
+ when 'failure' then 'Failed'
+ when 'pending' then 'Pending'
+ end
end
else
- 'tampered'
+ 'Tampered'
end
end
def invoice_ok?( order_id )
order_id.to_s == invoice.to_s