Business-Monzo

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.08     2017-06-08
        - Fix VERSION confusion by moving $Business::Monzo::VERSION
          into the main module to avoid parts of the cpan(m|ts) toolchain
          getting confused

0.07     2016-09-29
        - Rename distribution to Business-Monzo

0.06     2016-08-21
        - live API test is absorbed into emulated test so can run the same
          test against both live and emulated endpoints

0.05     2016-07-22
        - Use Any type for Booleans as some test failures with Bool related
          to incorrect coercion (?) of JSON::PP boolean types (GH #4)

0.04     2016-05-28
        - Add missing attributes to Transaction and Merchant objects (GH #3)

0.03     2016-05-22
        - Kwalitee improvements

README.md  view on Meta::CPAN

        say $e->request->{params}  if $e->request;
        say $e->request->{headers} if $e->request;
        say $e->request->{content} if $e->request;
    }
    catch ( $e ) {
        # some other failure?
        ...
    }

You can view some useful debugging information by setting the MONZO\_DEBUG
env varible, this will show the calls to the Monzo endpoints as well as a
stack trace in the event of exceptions:

    $ENV{MONZO_DEBUG} = 1;

# ATTRIBUTES

## token

Your Monzo access token, this is required

monzo_emulator.pl  view on Meta::CPAN

    post '/attachment/deregister' => sub {
        my ( $c ) = @_;

        my $id = $c->param( 'id' )
            || return $c->render( status => 400, text => "id required" );

        $c->render( json => {} );
    }
};

# convenience methods for file upload emulation, these endpoints
# do not exist in the Monzo API, they are here to fake uploads
get '/file/:entity_id/:file_name' => sub {
    my ( $c ) = @_;

    $c->render( text => "OK" );
};

post '/upload/:entity_id/:file_name' => sub {
    my ( $c ) = @_;

t/business/monzo.t  view on Meta::CPAN

        client
        transactions
        transaction
        accounts
    /,
);

isa_ok( $Monzo->client,'Business::Monzo::Client' );

# monkey patching Mojo::UserAgent here to make this test work without
# having to actually hit the endpoints or use credentials
no warnings 'redefine';
no warnings 'once';
my $mock = Test::MockObject->new;
$mock->mock( 'success',sub { 1 } );
$mock->mock( 'headers',sub { $mock } );
$mock->mock( 'result',sub { $mock } );
$mock->mock( 'is_success',sub { $mock } );
$mock->mock( 'message',sub { $mock } );
$mock->mock( 'code',sub { $mock } );
$mock->mock( 'json',sub { $mock } );

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.986 second using v1.00-cache-2.02-grep-82fe00e-cpan-bb1dbb8812f )