Class: AuthNetReceiver::Transaction

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/auth_net_receiver/transaction.rb

Instance Method Summary collapse

Instance Method Details

#is_approved?Boolean

Return true if the transaction was succesful This will be indicated by a Response Reason Code 1. All other codes indicate an error of some kind developer.authorize.net/tools/responsereasoncode/

Returns:

  • (Boolean)


19
20
21
# File 'app/models/auth_net_receiver/transaction.rb', line 19

def is_approved?
  return response_reason_code == 1
end

#is_subscription?Boolean

Return true if this record belongs to an Automated Recurring Billing subscription

Returns:

  • (Boolean)


11
12
13
# File 'app/models/auth_net_receiver/transaction.rb', line 11

def is_subscription?
  return self.subscription_id.present?
end