[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.61, 1.62
Ivan,,,
ivan at wavetail.420.am
Sun Nov 4 21:27:46 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail:/tmp/cvs-serv10421/FS/FS/ClientAPI
Modified Files:
MyAccount.pm
Log Message:
add process_payment_order_pkg method
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- MyAccount.pm 24 Sep 2007 15:47:50 -0000 1.61
+++ MyAccount.pm 5 Nov 2007 05:27:43 -0000 1.62
@@ -297,14 +297,14 @@
if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
$return{card_type} = cardtype($cust_main->payinfo);
- $return{payinfo} = $cust_main->payinfo;
+ $return{payinfo} = $cust_main->paymask;
@return{'month', 'year'} = $cust_main->paydate_monthyear;
}
if ( $cust_main->payby =~ /^(CHEK|DCHK)$/ ) {
- my ($payinfo1, $payinfo2) = split '@', $cust_main->payinfo;
+ my ($payinfo1, $payinfo2) = split '@', $cust_main->paymask;
$return{payinfo1} = $payinfo1;
$return{payinfo2} = $payinfo2;
$return{paytype} = $cust_main->paytype;
@@ -354,21 +354,28 @@
my $paycvv = '';
if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
- $p->{'payinfo1'} =~ /^(\d+)$/
+ $p->{'payinfo1'} =~ /^([\dx]+)$/
or return { 'error' => "illegal account number ". $p->{'payinfo1'} };
my $payinfo1 = $1;
- $p->{'payinfo2'} =~ /^(\d+)$/
+ $p->{'payinfo2'} =~ /^([\dx]+)$/
or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} };
my $payinfo2 = $1;
$payinfo = $payinfo1. '@'. $payinfo2;
+
+ $payinfo = $cust_main->payinfo
+ if $cust_main->paymask eq $payinfo;
} elsif ( $payby eq 'CARD' || $payby eq 'DCRD' ) {
$payinfo = $p->{'payinfo'};
- $payinfo =~ s/\D//g;
+ $payinfo =~ s/[^\dx]//g;
$payinfo =~ /^(\d{13,16})$/
or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo
$payinfo = $1;
+
+ $payinfo = $cust_main->payinfo
+ if $cust_main->paymask eq $payinfo;
+
validate($payinfo)
or return { 'error' => gettext('invalid_card') }; # . ": ". $self->payinfo
return { 'error' => gettext('unknown_card_type') }
@@ -432,6 +439,15 @@
}
+sub process_payment_order_pkg {
+ my $p = shift;
+
+ my $hr = process_payment($p);
+ return $hr if $hr->{'error'};
+
+ order_pkg($p);
+}
+
sub process_prepay {
my $p = shift;
More information about the freeside-commits
mailing list