06a2428bba1683033f8e431ff5770d7f5c7e58df
[Business-OnlinePayment-IPPay.git] / t / lib / test_account.pl
1 sub test_account_or_skip {
2     my $suffix = shift;
3     my($login, $password, %opt) = test_account($suffix);
4
5     unless( defined $login ) {
6         plan skip_all => "No test account";
7     }
8
9     return($login, $password, %opt);
10 }
11
12 sub test_account {
13     my $suffix = shift || 'card';
14
15     my($login, $password) = ('TESTMERCHANT', '');
16
17     my %opt;
18     if ( $suffix eq 'check ' ) {
19       %opt = ('Origin' => 'RECURRING');
20     } else {
21       %opt = ('default_Origin' => 'RECURRING');
22     }
23
24     return($login, $password, %opt);
25 }
26
27 sub expiration_date {
28     my($month, $year) = (localtime)[4,5];
29     $month += 1;
30     $year++;       # So we expire next year.
31     $year %= 100;  # y2k?  What's that?
32
33     return sprintf("%02d/%02d", $month, $year);
34 }
35
36 #sub tomorrow {
37 #    my($day, $month, $year) = (localtime(time+86400))[3..5];
38 #    return sprintf("%04d-%02d-%02d", $year+1900, ++$month, $day);
39 #}
40
41 1;
42