[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.53.2.24, 1.53.2.25
Ivan,,,
ivan at wavetail.420.am
Sun Oct 25 15:59:29 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv15152/FS/FS/ClientAPI
Modified Files:
Tag: FREESIDE_1_7_BRANCH
MyAccount.pm
Log Message:
backport realtime_collect to 1.7 for SG to use instead of calling collect, RT#5071
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.53.2.24
retrieving revision 1.53.2.25
diff -u -d -r1.53.2.24 -r1.53.2.25
--- MyAccount.pm 4 Oct 2009 23:31:11 -0000 1.53.2.24
+++ MyAccount.pm 25 Oct 2009 22:59:26 -0000 1.53.2.25
@@ -472,6 +472,28 @@
}
+sub realtime_collect {
+ my $p = shift;
+
+ my $session = _cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my $custnum = $session->{'custnum'};
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or return { 'error' => "unknown custnum $custnum" };
+
+ my $error = $cust_main->realtime_collect(
+ 'method' => $p->{'method'},
+ 'session_id' => $p->{'session_id'},
+ );
+ return { 'error' => $error } unless ref( $error );
+
+ my $amount = $cust_main->balance;
+
+ return { 'error' => '', amount => $amount, %$error };
+}
+
sub process_payment_order_pkg {
my $p = shift;
More information about the freeside-commits
mailing list