summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm36
-rwxr-xr-xfs_selfservice/DEPLOY6
2 files changed, 32 insertions, 10 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 80c7330e8..c722c9d5f 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -4,14 +4,16 @@ use strict;
use vars qw($cache);
use Digest::MD5 qw(md5_hex);
use Date::Format;
+use Business::CreditCard;
use Cache::SharedMemoryCache; #store in db?
use FS::CGI qw(small_custview); #doh
use FS::Conf;
-use FS::Record qw(qsearchs);
+use FS::Record qw(qsearch qsearchs);
use FS::svc_acct;
use FS::svc_domain;
use FS::cust_main;
use FS::cust_bill;
+use FS::cust_main_county;
use FS::ClientAPI; #hmm
FS::ClientAPI->register_handlers(
@@ -132,15 +134,38 @@ sub payment_info {
$return{$_} = $cust_main->get($_) for qw(address1 address2 city state zip);
+ $return{payby} = $cust_main->payby;
+
if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
- #$return{card_type} =
+ $return{card_type} = cardtype($cust_main->payinfo);
$return{payinfo} = $cust_main->payinfo;
- #exp date (month, year)
- #CARD vd DCRD remembering
+ if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #Pg date format
+ @return{'month', 'year'} = ( $2, $1 );
+ } elsif ( $cust_main->paydate =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ @return{'month', 'year'} = ( $1, $3 );
+ }
+
}
- #list all states & counties
+ #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',
+ };
return { 'error' => '',
%return,
@@ -148,7 +173,6 @@ sub payment_info {
};
-
sub invoice {
my $p = shift;
my $session = $cache->get($p->{'session_id'})
diff --git a/fs_selfservice/DEPLOY b/fs_selfservice/DEPLOY
index 7ab3b2a7a..4aef4cfa4 100755
--- a/fs_selfservice/DEPLOY
+++ b/fs_selfservice/DEPLOY
@@ -1,14 +1,12 @@
#!/bin/sh
+kill `cat /var/run/freeside-selfservice-server.fs_selfservice.pid`
+
( cd ..; make deploy; cd fs_selfservice )
cd FS-SelfService
perl Makefile.PL && make && make install
-cd ..
-kill `cat /var/run/freeside-selfservice-server.ivan.pid`; sleep 3
-./freeside-selfservice-server ivan localhost
-
cp /home/ivan/freeside/fs_selfservice/FS-SelfService/cgi/* /var/www/MyAccount
chown freeside /var/www/MyAccount/selfservice.cgi
chmod 755 /var/www/MyAccount/selfservice.cgi