diff options
author | fbriere <fbriere> | 2006-08-19 18:35:35 +0000 |
---|---|---|
committer | fbriere <fbriere> | 2006-08-19 18:35:35 +0000 |
commit | dee8162ed1772cded92c39a188dd584bd847318f (patch) | |
tree | 3652336a7435535aed737e17c009fb50fee41376 | |
parent | 69b4b8b6053186050e6bbb3be461934794cdf266 (diff) |
Added backwards-compatible support for avs_response
-rwxr-xr-x | InternetSecure.pm | 4 | ||||
-rwxr-xr-x | t/avs_response.t | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/InternetSecure.pm b/InternetSecure.pm index 9e9c701..0adb94f 100755 --- a/InternetSecure.pm +++ b/InternetSecure.pm @@ -50,6 +50,10 @@ sub set_defaults { $self->tax_amounts( {} ); } +# Backwards-compatible support for avs_response +sub avs_response { shift()->avs_code(@_) } + + # Combine get_fields and remap_fields for convenience. Unlike OnlinePayment's # remap_fields, this doesn't modify content(), and can therefore be called # more than once. Also, unlike OnlinePayment's get_fields in 3.x, this doesn't diff --git a/t/avs_response.t b/t/avs_response.t new file mode 100755 index 0000000..5720aa6 --- /dev/null +++ b/t/avs_response.t @@ -0,0 +1,22 @@ +# vim:set syntax=perl: + +use Test::More tests => 1 + 2; + +BEGIN { use_ok('Business::OnlinePayment') }; + + +my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000'; + +$txn->parse_response(<<__EOF__); +<?xml version="1.0" encoding="UTF-8"?> +<TranxResponse> + <CardType>Test Card Number</CardType> + <Page>2000</Page> + <AVSResponseCode>Z</AVSResponseCode> +</TranxResponse> +__EOF__ + +is($txn->avs_code, 'Z', 'avs_code'); +is($txn->avs_response, 'Z', 'avs_response'); + + |