class Starling::Resources::MastercardTransactionResource

A resource representing a Transaction returned from the Transactions Mastercard API

Public Instance Methods

amount() click to toggle source

@return [Float] the amount of the transaction

# File lib/starling/resources/mastercard_transaction_resource.rb, line 16
def amount
  present_float(parsed_data['amount'])
end
created() click to toggle source

@return [Time] the date and time when the transaction was recorded

# File lib/starling/resources/mastercard_transaction_resource.rb, line 26
def created
  present_datetime(parsed_data['created'])
end
Also aliased as: created_at
created_at()
Alias for: created
currency() click to toggle source

@return [String] the currency of the transaction (e.g. “GBP” or “UAH”)

# File lib/starling/resources/mastercard_transaction_resource.rb, line 11
def currency
  parsed_data['currency']
end
direction() click to toggle source

@return [Symbol] the direction of the transaction (e.g. `:outbound`)

# File lib/starling/resources/mastercard_transaction_resource.rb, line 21
def direction
  present_enum(parsed_data['direction'])
end
id() click to toggle source

@return [String] the Starling internal ID of the transaction

# File lib/starling/resources/mastercard_transaction_resource.rb, line 6
def id
  parsed_data['id']
end
mastercard_transaction_method() click to toggle source

@return [Symbol] the MasterCard transaction method of the transaction (e.g.

`:contactless`)
# File lib/starling/resources/mastercard_transaction_resource.rb, line 43
def mastercard_transaction_method
  present_enum(parsed_data['mastercardTransactionMethod'])
end
merchant_id() click to toggle source

@return [String] the Starling internal ID of the merchant

# File lib/starling/resources/mastercard_transaction_resource.rb, line 63
def merchant_id
  parsed_data['merchantId']
end
merchant_location_id() click to toggle source

@return [String] the Starling internal ID of the merchant location

# File lib/starling/resources/mastercard_transaction_resource.rb, line 68
def merchant_location_id
  parsed_data['merchantLocationId']
end
narrative() click to toggle source

@return [String] the narrative of the transaction

# File lib/starling/resources/mastercard_transaction_resource.rb, line 32
def narrative
  parsed_data['narrative']
end
source() click to toggle source

@return [Symbol] the source of the transaction (e.g. `:master_card`)

# File lib/starling/resources/mastercard_transaction_resource.rb, line 37
def source
  present_enum(parsed_data['source'])
end
source_amount() click to toggle source

@return [Float] the source amount of the transaction

# File lib/starling/resources/mastercard_transaction_resource.rb, line 58
def source_amount
  present_float(parsed_data['sourceAmount'])
end
source_currency() click to toggle source

@return [String] the source currency of the transaction (e.g. “GBP” or “UAH”)

# File lib/starling/resources/mastercard_transaction_resource.rb, line 53
def source_currency
  parsed_data['sourceCurrency']
end
status() click to toggle source

@return [Symbol] the status of the transaction (e.g. `:settled`)

# File lib/starling/resources/mastercard_transaction_resource.rb, line 48
def status
  present_enum(parsed_data['status'])
end