class OffsitePayments::Integrations::Doku::Notification

Public Instance Methods

acknowledge(authcode = nil) click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 155
def acknowledge(authcode = nil)
  case type
  when 'verify'
    words == Digest::SHA1.hexdigest("#{gross}#{@options[:credential2]}#{item_id}")
  when 'notify'
    true
  else
    false
  end
end
complete?() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 112
def complete?
  status.present?
end
currency() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 133
def currency
  'IDR'
end
gross() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 120
def gross
  params['AMOUNT']
end
item_id() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 116
def item_id
  params['TRANSIDMERCHANT']
end
status() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 124
def status
  case params['RESULT']
  when 'Success'
    'Completed'
  when 'Fail'
    'Failed'
  end
end
transaction_id() click to toggle source

no unique ID is generated by Doku at any point in the process, so use the same as the original order number.

# File lib/offsite_payments/integrations/doku.rb, line 151
def transaction_id
  params['TRANSIDMERCHANT']
end
type() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 141
def type
  if words && params['STOREID']
    'verify'
  elsif status
    'notify'
  end
end
words() click to toggle source
# File lib/offsite_payments/integrations/doku.rb, line 137
def words
  params['WORDS']
end