diff options
Diffstat (limited to 't/credit_card.t')
-rw-r--r-- | t/credit_card.t | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/t/credit_card.t b/t/credit_card.t index a41e14e..0063804 100644 --- a/t/credit_card.t +++ b/t/credit_card.t @@ -5,6 +5,10 @@ BEGIN { $| = 1; print "1..1\n"; } use Business::OnlinePayment; +my($month, $year) = (localtime)[4,5]; +$year++; # So we expire next year. +$year %= 100; # y2k? What's that? + my $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => 'VISA', @@ -22,7 +26,7 @@ $tx->content( state => 'UT', zip => '84058', card_number => '4007000000027', - expiration => '08/06', + expiration => sprintf("%02d/%02d", $month, $year), ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); @@ -30,6 +34,6 @@ $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { - #warn $tx->error_message; + warn $tx->error_message; print "not ok 1\n"; } |