freeside/FS/FS/ClientAPI MyAccount.pm,1.25,1.26
ivan
ivan at pouncequick.420.am
Sat Jul 10 07:31:04 PDT 2004
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory pouncequick:/tmp/cvs-serv19484/ClientAPI
Modified Files:
MyAccount.pm
Log Message:
tyop;
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- MyAccount.pm 1 Jul 2004 13:49:28 -0000 1.25
+++ MyAccount.pm 10 Jul 2004 14:31:00 -0000 1.26
@@ -212,7 +212,41 @@
my $session = $cache->get($p->{'session_id'})
or return { 'error' => "Can't resume session" }; #better error message
- my %return;
+ ##
+ #generic
+ ##
+
+ my $conf = new FS::Conf;
+ my %states = map { $_->state => 1 }
+ qsearch('cust_main_county', {
+ 'country' => $conf->config('defaultcountry') || 'US'
+ } );
+
+ use vars qw($payment_info); #cache for performance
+ $payment_info ||= {
+
+ #list all counties/states/countries
+ 'cust_main_county' =>
+ [ map { $_->hashref } qsearch('cust_main_county', {}) ],
+
+ #shortcut for one-country folks
+ 'states' =>
+ [ sort { $a cmp $b } keys %states ],
+
+ 'card_types' => {
+ 'VISA' => 'VISA card',
+ 'MasterCard' => 'MasterCard',
+ 'Discover' => 'Discover card',
+ 'American Express' => 'American Express card',
+ },
+
+ };
+
+ ##
+ #customer-specific
+ ##
+
+ my %return = %$payment_info;
my $custnum = $session->{'custnum'};
@@ -236,25 +270,7 @@
}
- #list all counties/states/countries
- $return{'cust_main_county'} =
- [ map { $_->hashref } qsearch('cust_main_county', {}) ];
-
- #shortcut for one-country folks
- my $conf = new FS::Conf;
- my %states = map { $_->state => 1 }
- qsearch('cust_main_county', {
- 'country' => $conf->config('defaultcountry') || 'US'
- } );
- $return{'states'} = [ sort { $a cmp $b } keys %states ];
-
- $return{card_types} = {
- 'VISA' => 'VISA card',
- 'MasterCard' => 'MasterCard',
- 'Discover' => 'Discover card',
- 'American Express' => 'American Express card',
- };
-
+ #doubleclick protection
my $_date = time;
$return{paybatch} = "webui-MyAccount-$_date-$$-". rand() * 2**32;
More information about the freeside-commits
mailing list