Class: Starling::Resources::MastercardTransactionResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Starling::Resources::MastercardTransactionResource
- Defined in:
- lib/starling/resources/mastercard_transaction_resource.rb
Overview
A resource representing a Transaction returned from the Transactions Mastercard API
Instance Method Summary collapse
-
#amount ⇒ Float
The amount of the transaction.
-
#created ⇒ Time
(also: #created_at)
The date and time when the transaction was recorded.
-
#currency ⇒ String
The currency of the transaction (e.g. “GBP” or “UAH”).
-
#direction ⇒ Symbol
The direction of the transaction (e.g. ‘:outbound`).
-
#id ⇒ String
The Starling internal ID of the transaction.
-
#mastercard_transaction_method ⇒ Symbol
The MasterCard transaction method of the transaction (e.g. ‘:contactless`).
-
#merchant_id ⇒ String
The Starling internal ID of the merchant.
-
#merchant_location_id ⇒ String
The Starling internal ID of the merchant location.
-
#narrative ⇒ String
The narrative of the transaction.
-
#source ⇒ Symbol
The source of the transaction (e.g. ‘:master_card`).
-
#source_amount ⇒ Float
The source amount of the transaction.
-
#source_currency ⇒ String
The source currency of the transaction (e.g. “GBP” or “UAH”).
-
#status ⇒ Symbol
The status of the transaction (e.g. ‘:settled`).
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Starling::Resources::BaseResource
Instance Method Details
#amount ⇒ Float
Returns the amount of the transaction.
16 17 18 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 16 def amount present_float(parsed_data['amount']) end |
#created ⇒ Time Also known as: created_at
Returns the date and time when the transaction was recorded.
26 27 28 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 26 def created present_datetime(parsed_data['created']) end |
#currency ⇒ String
Returns the currency of the transaction (e.g. “GBP” or “UAH”).
11 12 13 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 11 def currency parsed_data['currency'] end |
#direction ⇒ Symbol
Returns the direction of the transaction (e.g. ‘:outbound`).
21 22 23 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 21 def direction present_enum(parsed_data['direction']) end |
#id ⇒ String
Returns the Starling internal ID of the transaction.
6 7 8 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 6 def id parsed_data['id'] end |
#mastercard_transaction_method ⇒ Symbol
Returns the MasterCard transaction method of the transaction (e.g. ‘:contactless`).
43 44 45 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 43 def mastercard_transaction_method present_enum(parsed_data['mastercardTransactionMethod']) end |
#merchant_id ⇒ String
Returns the Starling internal ID of the merchant.
63 64 65 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 63 def merchant_id parsed_data['merchantId'] end |
#merchant_location_id ⇒ String
Returns the Starling internal ID of the merchant location.
68 69 70 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 68 def merchant_location_id parsed_data['merchantLocationId'] end |
#narrative ⇒ String
Returns the narrative of the transaction.
32 33 34 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 32 def narrative parsed_data['narrative'] end |
#source ⇒ Symbol
Returns the source of the transaction (e.g. ‘:master_card`).
37 38 39 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 37 def source present_enum(parsed_data['source']) end |
#source_amount ⇒ Float
Returns the source amount of the transaction.
58 59 60 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 58 def source_amount present_float(parsed_data['sourceAmount']) end |
#source_currency ⇒ String
Returns the source currency of the transaction (e.g. “GBP” or “UAH”).
53 54 55 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 53 def source_currency parsed_data['sourceCurrency'] end |
#status ⇒ Symbol
Returns the status of the transaction (e.g. ‘:settled`).
48 49 50 |
# File 'lib/starling/resources/mastercard_transaction_resource.rb', line 48 def status present_enum(parsed_data['status']) end |