From 443d3f5eeef9c2fb1ed5320824be78c6271e631f Mon Sep 17 00:00:00 2001 From: plobbes Date: Sat, 18 Oct 2008 17:35:37 +0000 Subject: [PATCH] =?utf8?q?-=20incorporate=20most=20of=20patches=20from=20F?= =?utf8?q?r=C3=A9d=C3=A9ric=20Bri=C3=A8re,=20including=20tests=20=20=20for?= =?utf8?q?=20cvv2=5Fcode=20client=5Fcertification=5Fid=20client=5Ftimeout?= =?utf8?q?=20request=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- t/bop.t | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/t/bop.t b/t/bop.t index c41188d..2fbab5a 100644 --- a/t/bop.t +++ b/t/bop.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 24; use Business::OnlinePayment; @@ -30,6 +30,39 @@ my $driver = "PayflowPro"; is( $obj->port, "443", "port(443)" ); } +{ # cvv2_response / cvv2_code + my $obj = $package->new($driver); + + my $exp = "Z"; + $obj->cvv2_response($exp); + + is( $obj->cvv2_response, $exp, "cvv2_response() is set" ); + is( $obj->cvv2_code, $exp, "cvv2_code() calls cvv2_response" ); +} + +{ # client_certification_id + my $obj = $package->new($driver); + + my $id = $obj->client_certification_id; + isnt( $id, "", "client_certification_id() is set" ); + + $id = "foo"; + is( $obj->client_certification_id($id), + $id, "client_certification_id() can be set" ); + is( $obj->client_certification_id, + $id, "client_certification_id() remains set" ); +} + +{ # client_timeout + my $obj = $package->new($driver); + + is( $obj->client_timeout, 45, "client_timeout() returns 45 by default" ); + + my $to = 60; + is( $obj->client_timeout($to), $to, "client_timeout() can be set" ); + is( $obj->client_timeout, $to, "client_timeout() remains set" ); +} + { # expdate my $obj = $package->new($driver); my @exp = ( @@ -49,3 +82,19 @@ my $driver = "PayflowPro"; is( $mmyy, $moyr, "$exp: MMYY '$mmyy' eq '$moyr' from $exp" ); } } + +{ # request_id + my $obj = $package->new($driver); + + my $id = $obj->request_id; + isnt( $id, "", "request_id() returns something" ); + + is( $obj->request_id, $id, "request_id() returns the same value" ); + + $obj = $package->new($driver); + isnt( $obj->request_id, $id, "request_id() is different for each object" ); + + $id = "foo"; + is( $obj->request_id($id), $id, "request_id() can be set" ); + is( $obj->request_id, $id, "request_id() remains set" ); +} -- 2.11.0