TestPayment.pm (interchange-5.8.2) | : | TestPayment.pm (interchange-5.10.0) | ||
---|---|---|---|---|
# Vend::Payment::TestPayment - Interchange payment test module | # Vend::Payment::TestPayment - Interchange payment test module | |||
# | # | |||
# $Id: TestPayment.pm,v 1.10 2007-08-09 13:40:55 pajamian Exp $ | # $Id: TestPayment.pm,v 1.10 2007-08-09 13:40:55 pajamian Exp $ | |||
# | # | |||
# Copyright (C) 2002-2007 Interchange Development Group | # Copyright (C) 2002-2016 Interchange Development Group | |||
# Copyright (C) 2002 Cursor Software Limited. | # Copyright (C) 2002 Cursor Software Limited. | |||
# All Rights Reserved. | # All Rights Reserved. | |||
# | # | |||
# Author: Kevin Walsh <kevin@cursor.biz> | # Author: Kevin Walsh <kevin@cursor.biz> | |||
# Based on original code by Mike Heins <mheins@perusion.com> | # Based on original code by Mike Heins <mheins@perusion.com> | |||
# | # | |||
# This program is free software; you can redistribute it and/or modify | # This program is free software; you can redistribute it and/or modify | |||
# it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | |||
# the Free Software Foundation; either version 2 of the License, or | # the Free Software Foundation; either version 2 of the License, or | |||
# (at your option) any later version. | # (at your option) any later version. | |||
skipping to change at line 60 | skipping to change at line 60 | |||
could switch from TestPayment to another payment module with a few | could switch from TestPayment to another payment module with a few | |||
configuration file changes. | configuration file changes. | |||
The module will perform one of three actions: | The module will perform one of three actions: | |||
=over 4 | =over 4 | |||
=item * | =item * | |||
If the card number is 4111111111111111 then the transaction will be approved. | If the card number is 4111111111111111 then the transaction will be approved. | |||
Additional approval numbers include 6011333333333333 (discover), 545454545454545 | ||||
4 | ||||
(mc), 341111111111111 (amex). | ||||
=item * | =item * | |||
If the card number is 4111111111111129 then the transaction will be declined. | If the card number is 4111111111111129 then the transaction will be declined. | |||
=item * | =item * | |||
Any other card number will raise an error and the transaction will be declined. | Any other card number will raise an error and the transaction will be declined. | |||
=back | =back | |||
skipping to change at line 322 | skipping to change at line 324 | |||
elsif($opt->{auth_code}) { | elsif($opt->{auth_code}) { | |||
$result{'pop.status'} = 'failure'; | $result{'pop.status'} = 'failure'; | |||
$result{'pop.error-message'} = errmsg($msg,'Need auth-cod e'); | $result{'pop.error-message'} = errmsg($msg,'Need auth-cod e'); | |||
} | } | |||
else { | else { | |||
$result{'pop.status'} = 'success'; | $result{'pop.status'} = 'success'; | |||
$result{'pop.order-id'} = $opt->{order_id}; | $result{'pop.order-id'} = $opt->{order_id}; | |||
$result{'pop.auth-code'} = $opt->{auth_code}; | $result{'pop.auth-code'} = $opt->{auth_code}; | |||
} | } | |||
} | } | |||
elsif ($actual->{mv_credit_card_number} eq '4111111111111111'){ | elsif ($actual->{mv_credit_card_number} =~ /^(4111111111111111|6011333333333 333|5454545454545454|341111111111111)$/){ | |||
$result{'pop.status'} = 'success'; | $result{'pop.status'} = 'success'; | |||
$result{'pop.order-id'} = $opt->{order_id}; | $result{'pop.order-id'} = $opt->{order_id}; | |||
$result{'pop.auth-code'} = 'test_auth_code'; | $result{'pop.auth-code'} = 'test_auth_code'; | |||
} | } | |||
elsif ($actual->{mv_credit_card_number} eq '4111111111111129'){ | elsif ($actual->{mv_credit_card_number} eq '4111111111111129'){ | |||
$msg ||= 'TestPayment error: %s. Please call in your order or tr y again.'; | $msg ||= 'TestPayment error: %s. Please call in your order or tr y again.'; | |||
$result{'pop.status'} = 'failure'; | $result{'pop.status'} = 'failure'; | |||
$result{'pop.error-message'} = | $result{'pop.error-message'} = | |||
errmsg($msg,'Payment declined by the card issuer'); | errmsg($msg,'Payment declined by the card issuer'); | |||
} | } | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added |