[freeside-commits] freeside/FS/FS/ClientAPI SGNG.pm,1.1,1.2

Ivan,,, ivan at wavetail.420.am
Tue Mar 17 14:38:20 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv28734/FS/FS/ClientAPI

Modified Files:
	SGNG.pm 
Log Message:
add payment_info_renew_info method to ClientAPI/MyAccount and SG-equivalent previous_payment_info_renew_info to ClientAPI/SGNG

Index: SGNG.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/SGNG.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- SGNG.pm	17 Mar 2009 19:48:32 -0000	1.1
+++ SGNG.pm	17 Mar 2009 21:38:18 -0000	1.2
@@ -7,6 +7,7 @@
 use Time::Local qw(timelocal timelocal_nocheck);
 use Business::CreditCard;
 use FS::Record qw( qsearch qsearchs );
+use FS::Conf;
 use FS::cust_main;
 use FS::cust_pkg;
 use FS::ClientAPI::MyAccount; #qw( payment_info process_payment )
@@ -158,6 +159,10 @@
 
 #find old cust_main records (with payments)
 sub _previous_cust_main {
+
+  #safety check!  return nothing unless we're enabled explicitly
+  return () unless FS::Conf->new->exists('sg-multicustomer_hack');
+
   my %opt = @_;
   my $custnum  = $opt{'custnum'};
   my $username = $opt{'username'};
@@ -225,6 +230,15 @@
 
 }
 
+sub previous_payment_info_renew_info {
+  my $p = shift;
+  my $renew_info   = renew_info($p);
+  my $payment_info = previous_payment_info($p);
+  return { %$renew_info,
+           %$payment_info,
+         };
+}
+
 sub previous_process_payment_order_pkg {
   my $p = shift;
 



More information about the freeside-commits mailing list