From ef8b468214d2917b90f0537130f14c217ea71224 Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Mon, 22 Apr 2019 22:09:39 -0400 Subject: Tokenization processing, refinements, tests --- t/052-action-fail.t | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 t/052-action-fail.t (limited to 't/052-action-fail.t') diff --git a/t/052-action-fail.t b/t/052-action-fail.t new file mode 100755 index 0000000..7c4f08a --- /dev/null +++ b/t/052-action-fail.t @@ -0,0 +1,48 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use lib 't'; +use TestFixtures; +use Business::OnlinePayment; +use Data::Dumper; + $Data::Dumper::Sortkeys = 1; + $Data::Dumper::Indent = 1; + +my $merchant_id = $ENV{BAMBORA_MERCHANT_ID}; +my $api_key = $ENV{BAMBORA_API_KEY}; + +SKIP: { + skip 'Missing env vars BAMBORA_MERCHANT_ID and BAMBORA_API_KEY', 6 + unless $merchant_id && $api_key; + + # + # Attempt with invalid action name + # Expect fail + # + + my %content_fail = ( + common_content(), + + login => $merchant_id, + password => $api_key, + + action => 'Norml Authorzatin', + amount => '24.95', + ); + + my ( $tr_fail, $response_fail ) = make_api_request( \%content_fail ); + + inspect_transaction( + $tr_fail, + { is_success => 0 }, + [qw/ error_message /], + ); + + ok( $tr_fail->error_message =~ /action is unsupported/i, + 'Saw expected error_message' + ); +} + +done_testing; \ No newline at end of file -- cgit v1.2.1