summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/payment.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-02-20 16:48:48 -0800
committerMark Wells <mark@freeside.biz>2013-02-20 16:48:48 -0800
commitf00c16b7e3e6306723ea8b3029e061cff100b901 (patch)
tree4ade4530a01b5508e3b9d118709d50674f9b50e7 /httemplate/misc/process/payment.cgi
parentd7135a628c2e30cb31ce062d730b4288c38cae98 (diff)
save changes to credit card billing address, #940
Diffstat (limited to 'httemplate/misc/process/payment.cgi')
-rw-r--r--httemplate/misc/process/payment.cgi10
1 files changed, 9 insertions, 1 deletions
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 506e26684..981614e76 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -210,7 +210,15 @@ if ( $cgi->param('save') ) {
$new->set( 'paycvv' => '');
}
- $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}};
+ if ( $payby eq 'CARD' ) {
+ my $bill_location = FS::cust_location->new;
+ $bill_location->set( $_ => $cgi->param($_) )
+ foreach @{$payby2fields{$payby}};
+ $new->set('bill_location' => $bill_location);
+ # will do nothing if the fields are all unchanged
+ } else {
+ $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}};
+ }
my $error = $new->replace($cust_main);
errorpage("payment processed successfully, but error saving info: $error")