NAME

Business::Monzo::Transaction

DESCRIPTION

A class for a Monzo transaction, extends Business::Monzo::Resource

ATTRIBUTES

The Transaction class has the following attributes (with their type).

    id (Str)
    account_id (Str)
    category (Str)
    dedupe_id (Str)
    description (Str)
    notes (Str)
    scheme (Str)
    account_balance (Int)
    amount (Int)
    local_amount (Int)
    counterparty (HashRef)
    metadata (HashRef)
    is_load (Bool)
    originator (Bool)
    merchant (Business::Monzo::Merchant)
    currency (Data::Currency)
    local_currency (Data::Currency)
    created (DateTime)
    updated (DateTime)
    settled (DateTime)
    attachments (ArrayRef[Business::Monzo::Attachment])

Note that if a HashRef or Str is passed to ->merchant it will be coerced into a Business::Monzo::Merchant object. When a Str is passed to ->currency / ->local_currency this will be coerced to a Data::Currency object, and when a Str is passed to ->created / ->updated / ->settled this will be coerced to a DateTime object.

Operations on an transaction

get

Returns a new instance of the object populated with the attributes having called the API

    my $populated_transaction = $transaction->get;

This is for when you have instantiated an object with the id, so calling the API will retrieve the full details for the entity.

annotate

Returns a new instance of the object with annotated data having called the API

    my $annotated_transaction = $transaction->annotate(
        foo => "bar",
        baz => "boz,
    );

SEE ALSO

Business::Monzo

Business::Monzo::Resource

AUTHOR

Lee Johnson - leejo@cpan.org

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation, features, bug fixes, or anything else then please raise an issue / pull request:

    https://github.com/leejo/business-monzo