~ubuntu-branches/ubuntu/saucy/libbusiness-onlinepayment-ippay-perl/saucy

« back to all changes in this revision

Viewing changes to .pc/no-connectivity.patch/t/card.t

  • Committer: Package Import Robot
  • Author(s): Xavier Guimard, Ansgar Burchardt, gregor herrmann, Salvatore Bonaccorso, Xavier Guimard
  • Date: 2013-05-12 13:04:17 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130512130417-7gjjtpog3lhohhap
Tags: 0.08-1
[ Ansgar Burchardt ]
* debian/control: Convert Vcs-* fields to Git.

[ gregor herrmann ]
* Drop patch gateway.patch, included in 0.07.
* debian/copyright: update Upstream-Contact.

[ Salvatore Bonaccorso ]
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Xavier Guimard ]
* Imported Upstream version 0.08
* Bump Standards-Version to 3.9.4
* Bump debhelper compatibility to 8
* Add myself in uploaders
* Update d/copyright to format 1.0
* Replace "Subject" by "description" in patch as required by cme

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
require "t/lib/test_account.pl";
5
5
 
6
6
my($login, $password, %opt) = test_account_or_skip('card');
7
 
plan tests => 43;
 
7
plan tests => 50;
8
8
  
9
9
use_ok 'Business::OnlinePayment';
10
10
 
61
61
    $tx,
62
62
    desc          => "invalid card_number",
63
63
    is_success    => 0,
64
 
    result_code   => '912',
65
 
    error_message => 'INVALID CARD NUMBER',
 
64
    result_code   => '900', #'912' with old jetpay gw
 
65
    error_message => 'Invalid card number.  ', #'INVALID CARD NUMBER' w/old gw
66
66
    authorization => qr/^$/,
67
67
    avs_code      => '',           # so rather pointless :\
68
68
    cvv2_response => '',           # ...
89
89
  $postable_amount = $content{amount} if $tx->is_success;
90
90
}
91
91
 
 
92
# authorization void test
 
93
{
 
94
  my $tx = Business::OnlinePayment->new("IPPay", %opt);
 
95
  $tx->content(%content, action => 'authorization only',  amount => '3.00' );
 
96
  $tx->test_transaction(1);
 
97
  $tx->submit;
 
98
 
 
99
  if ($tx->is_success) {
 
100
    my $void_tx = Business::OnlinePayment->new("IPPay", %opt );
 
101
 
 
102
    $tx->content(%content, action       => 'reverse authorization',
 
103
                           order_number => $tx->order_number );
 
104
    tx_check(
 
105
      $tx,
 
106
      desc          => "reverse authorization",
 
107
      is_success    => 1,
 
108
      result_code   => '000',
 
109
      error_message => 'APPROVED',
 
110
      authorization => qr/TEST\d{2}/,
 
111
      avs_code      => '',          # so rather pointless :\
 
112
      cvv2_response => '',          # ...
 
113
    );
 
114
  }
 
115
  else {
 
116
    
 
117
  }
 
118
}
 
119
 
92
120
# post authorization test
93
121
SKIP: {
94
122
  my $tx = new Business::OnlinePayment( "IPPay", %opt );