[freeside-commits] branch FREESIDE_4_BRANCH updated. 54638c01852123edd816e1c6e50b3690f88fb7e3
Christopher Burger
burgerc at freeside.biz
Tue Oct 30 19:01:16 PDT 2018
The branch, FREESIDE_4_BRANCH has been updated
via 54638c01852123edd816e1c6e50b3690f88fb7e3 (commit)
from 9da9204680e90853ef8609df415fbb53331db509 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 54638c01852123edd816e1c6e50b3690f88fb7e3
Author: Christopher Burger <burgerc at freeside.biz>
Date: Tue Oct 30 11:07:15 2018 -0400
RT# 79902 - fixed so change payment information link will still work when upgraded from V3 to V4 and restores functionality in V3
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index dbecb9b67..d4fa15924 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -876,12 +876,18 @@ sub payment_info {
$return{$_} = $cust_main->bill_location->get($_)
for qw(address1 address2 city state zip);
+ $p->{'payment_payby'} = $payment_info->{paybys} if !$p->{'payment_payby'};
+
# look for stored cust_payby info
# only if we've been given a clear payment_payby (to avoid payname conflicts)
- if ($p->{'payment_payby'} =~ /^(CARD|CHEK)$/) {
- my @search_payby = ($p->{'payment_payby'} eq 'CARD') ? ('CARD','DCRD') : ('CHEK','DCHK');
+ if ($p->{'payment_payby'} =~ /^(CARD|CHEK)$/ || (ref($p->{'payment_payby'}))) {
+ my @search_payby = ();
+ if ($p->{'payment_payby'} eq 'CARD') { @search_payby = ('CARD','DCRD'); }
+ elsif ($p->{'payment_payby'} eq 'CHEK') { @search_payby = ('CHEK','DCHK'); }
+ elsif (ref($p->{'payment_payby'}) eq 'ARRAY') { @search_payby = @{$payment_info->{paybys}}; }
my ($cust_payby) = $cust_main->cust_payby(@search_payby);
if ($cust_payby) {
+ $return{payby} = $cust_payby->payby;
$return{payname} = $cust_payby->payname
|| ( $cust_main->first. ' '. $cust_main->get('last') );
$return{custpaybynum} = $cust_payby->custpaybynum;
diff --git a/fs_selfservice/FS-SelfService/cgi/change_pay.html b/fs_selfservice/FS-SelfService/cgi/change_pay.html
index f90f6d92b..75ceee8f7 100644
--- a/fs_selfservice/FS-SelfService/cgi/change_pay.html
+++ b/fs_selfservice/FS-SelfService/cgi/change_pay.html
@@ -14,6 +14,7 @@
my $tail = qq(</TABLE>).
qq(<INPUT TYPE="hidden" NAME="action" VALUE="process_change_pay">).
+ qq(<INPUT TYPE="hidden" NAME="custpaybynum" VALUE="$custpaybynum">).
qq(<BR>).
qq(<INPUT TYPE="submit" NAME="process" ).
qq(VALUE="Save payment information"> ).
@@ -60,9 +61,6 @@
delete $options{'DCRD'} unless $payby eq 'DCRD' || ! exists $options{'CARD'};
delete $options{'DCHK'} unless $payby eq 'DCHK' || ! exists $options{'CHEK'};
- ## set default layer to first payby.
- @p = keys %options; $payby = $p[0];
-
HTML::Widgets::SelectLayers->new(
options => \%options,
selected_layer => $payby,
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index 3dc69e142..779ef3357 100755
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -12,7 +12,7 @@ use Date::Format;
use Date::Parse 'str2time';
use Number::Format 1.50;
use FS::SelfService qw(
- access_info login_info login customer_info edit_info insert_payby update_payby
+ access_info login_info login customer_info edit_info insert_payby update_payby
invoice payment_info process_payment realtime_collect process_prepay
list_pkgs order_pkg signup_info order_recharge
part_svc_info provision_acct provision_external provision_phone provision_forward
@@ -385,8 +385,9 @@ sub process_change_ship {
sub process_change_pay {
my $postal = $cgi->param( 'postal_invoicing' );
my $payby = $cgi->param( 'payby' );
+ $cgi->param('paydate', $cgi->param('year') . '-' . $cgi->param('month') . '-01');
my @list =
- qw( payby payinfo payinfo1 payinfo2 month year payname
+ qw( payby payinfo payinfo1 payinfo2 month year paydate payname custpaybynum
address1 address2 city county state zip country auto paytype
paystate ss stateid stateid_state invoicing_list
);
@@ -404,7 +405,11 @@ sub process_change_pay {
};
}
- _process_change_info( 'change_pay', @list );
+ if (FS::SelfService->can('update_payby')) {
+ if ($cgi->param( 'custpaybynum' )) { _process_change_payby( 'change_pay', @list ); }
+ else { _process_insert_payby( 'change_pay', @list ); }
+ }
+ else { _process_change_info( 'change_pay', @list ); }
}
sub process_change_creditcard_pay {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MyAccount.pm | 10 ++++++++--
fs_selfservice/FS-SelfService/cgi/change_pay.html | 4 +---
fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 11 ++++++++---
3 files changed, 17 insertions(+), 8 deletions(-)
More information about the freeside-commits
mailing list