diff options
author | ivan <ivan> | 2011-01-26 21:16:04 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-01-26 21:16:04 +0000 |
commit | 3d14e9d827c8fb53193d7534e3d13ef5aa288660 (patch) | |
tree | 2b1a507d42e2ef0ad5307c5a131ee36fbee64868 /t/lib | |
parent | 3522afcdab42daa2351f16e9f17f79d55f0eeb75 (diff) |
0.06: fix january bug in tests
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/test_account.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl new file mode 100644 index 0000000..06a2428 --- /dev/null +++ b/t/lib/test_account.pl @@ -0,0 +1,42 @@ +sub test_account_or_skip { + my $suffix = shift; + my($login, $password, %opt) = test_account($suffix); + + unless( defined $login ) { + plan skip_all => "No test account"; + } + + return($login, $password, %opt); +} + +sub test_account { + my $suffix = shift || 'card'; + + my($login, $password) = ('TESTMERCHANT', ''); + + my %opt; + if ( $suffix eq 'check ' ) { + %opt = ('Origin' => 'RECURRING'); + } else { + %opt = ('default_Origin' => 'RECURRING'); + } + + return($login, $password, %opt); +} + +sub expiration_date { + my($month, $year) = (localtime)[4,5]; + $month += 1; + $year++; # So we expire next year. + $year %= 100; # y2k? What's that? + + return sprintf("%02d/%02d", $month, $year); +} + +#sub tomorrow { +# my($day, $month, $year) = (localtime(time+86400))[3..5]; +# return sprintf("%04d-%02d-%02d", $year+1900, ++$month, $day); +#} + +1; + |