File: check.t

package info (click to toggle)
libbusiness-onlinepayment-authorizenet-perl 3.16-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 92 kB
  • ctags: 14
  • sloc: perl: 341; makefile: 50
file content (39 lines) | stat: -rw-r--r-- 1,100 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -w

use Test::More;
require "t/lib/test_account.pl";

my($login, $password) = test_account_or_skip('ach');
plan tests => 2;

use_ok 'Business::OnlinePayment';

my $ctx = Business::OnlinePayment->new("AuthorizeNet");
$ctx->server('test.authorize.net');
$ctx->content(
    type           => 'CHECK',
    login          => $login,
    password       => $password,
    action         => 'Normal Authorization',
    amount         => '49.95',
    invoice_number => '100100',
    customer_id    => 'jsk',
    first_name     => 'Tofu',
    last_name      => 'Beast',
    account_name   => 'Tofu Beast',
    account_number => '12345',
    routing_code   => '111000025',  # BoA in Texas taken from Wikipedia
    bank_name      => 'First National Test Bank',
    account_type   => 'Checking',
    license_num    => '12345678',
    license_state  => 'OR',
    license_dob    => '1975-05-21',
);
$ctx->test_transaction(1); # test, dont really charge
$ctx->submit();

SKIP: {
    skip $ctx->error_message, 1 if $ctx->result_code == 18;

    ok( $ctx->is_success() ) || diag $ctx->error_message;
}