module Monzo::Client::Transactions

Overview

Exposes methods for dealing with Transactions and manipulating their annotations/metadata, as defined by the Transaction API documentation.

Direct including types

Defined in:

monzo/client/transactions.cr

Instance Method Summary

Instance Method Detail

def annotate(transaction_id : String, name : String, value : String) #

Applies an annotation to a Transaction with the specified transaction_id.


[View source]
def annotate(transaction : Monzo::Transaction, name : String, value : String) #

Applies an annotation to the specified transaction.

transaction = client.transactions.first
 client.annotate(transaction, "Rating", "Best coffee in London") # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={"Rating"=>"Best coffee in London"}, ... >]

[View source]
def annotate(transaction_id : String, annotations : Array(Tuple(String, String))) #

Applies multiple annotations to a Transaction with the specified transaction_id.


[View source]
def annotate(transaction : Monzo::Transaction, annotations : Array(Tuple(String, String))) #

Applies multiple annotations to the specified transaction.

transaction = client.transactions.first
client.annotate(transaction, [{"Vegan", "Pretty good"}, {"Veggie", "Everything is veggie"}]) # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={"Vegan"=>"Pretty good.", "Veggie"=>"Everything is veggie."}, ... >]

[View source]
def remove_annotation(transaction_id : String, key : String) #

Remvoes an annotation from a Transaction with the specified transaction_id.


[View source]
def remove_annotation(transaction : Monzo::Transaction, key : String) #

Removes an annotation from the specified transaction.

transaction = client.transactions.first # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={"Rating"=>"Best coffee in London"}, ... >]
client.remove_annotation(transaction, "Rating") # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={}, ... >]

[View source]
def remove_annotations(transaction_id : String, keys : Array(String)) #

Remove multiple anntatons from a Transaction with the specifed transaction_id.


[View source]
def remove_annotations(transaction : Monzo::Transaction, keys : Array(String)) #

Removes multiple annotations from the specified transaction.

transaction = client.transactions.first # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={"Vegan"=>"Pretty good.", "Veggie"=>"Everything is veggie."}, ... >]
client.remove_annotations(transaction, ["Vegan", "Veggie"]) # => #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @metadata={}, ... >]

[View source]
def transaction(transaction_id : String) #

Returns a Transaction for the specified transaction_id.

client.transaction("tx_TRANSACTIONID") #=> #<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @amount=10000, ... >]

[View source]
def transactions(account : Account) #

Returns Transactions for the specified account.

account = client.accounts.first
client.transactions(account) # => [#<Monzo::Transaction:0x104163f00 @id="tx_TRANSACTIONID", @amount=10000, @currency="GBP", ... >]

[View source]
def transactions(account_id : String) #

Returns Transactions for the specified account_id.


[View source]