class Promisepay::Transaction

Manage Transactions

Public Instance Methods

fee() click to toggle source

Gets a transactions fee details if applicable.

@see reference.promisepay.com/#shows-transaction-fees

@return [Promisepay::Fee]

# File lib/promisepay/models/transaction.rb, line 19
def fee
  response = JSON.parse(@client.get("transactions/#{send(:id)}/fees").body)
  response.key?('fees') ? Promisepay::Fee.new(@client, response['fees']) : nil
end
user() click to toggle source

Show the User associated with the Transaction.

@see reference.promisepay.com/#show-transaction-user

@return [Promisepay::User]

# File lib/promisepay/models/transaction.rb, line 9
def user
  response = JSON.parse(@client.get("transactions/#{send(:id)}/users").body)
  response.key?('users') ? Promisepay::User.new(@client, response['users']) : nil
end