class OffsitePayments::Integrations::HiTrust::Notification

Constants

SUCCESS

Public Instance Methods

account() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 100
def account
  params['storeid']
end
acknowledge() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 112
def acknowledge
  true
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 72
def complete?
  status == 'Completed'
end
currency() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 88
def currency
  params['currency']
end
gross() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 92
def gross
  sprintf("%.2f", gross_cents.to_f / 100)
end
gross_cents() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 96
def gross_cents
  params['approveamount'].to_i
end
item_id() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 80
def item_id
  params['ordernumber']
end
received_at() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 84
def received_at
  Time.parse(params['orderdate']) rescue nil
end
status() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 104
def status
  params['retcode'] == SUCCESS ? 'Completed' : 'Failed'
end
test?() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 108
def test?
  OffsitePayments.mode == :test
end
transaction_id() click to toggle source
# File lib/offsite_payments/integrations/hi_trust.rb, line 76
def transaction_id
  params['authRRN']
end