[freeside-commits] branch master updated. 2c9afab170b692b81afa1339145224530051c0b6

Ivan ivan at 420.am
Tue Apr 5 17:54:04 PDT 2016


The branch, master has been updated
       via  2c9afab170b692b81afa1339145224530051c0b6 (commit)
      from  103e953c1c6f71a7360327e8dde4442e02ae4084 (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 2c9afab170b692b81afa1339145224530051c0b6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Apr 5 17:54:03 2016 -0700

    add date to cancel_pkg self-service API, RT#41645

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 62bd9e8..d6fa865 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2671,19 +2671,18 @@ sub cancel_pkg {
     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 $pkgnum = $p->{'pkgnum'};
-
   my $cust_pkg = qsearchs('cust_pkg', { 'custnum' => $custnum,
                                         'pkgnum'  => $pkgnum,   } )
     or return { 'error' => "unknown pkgnum $pkgnum" };
 
-  my $error = $cust_pkg->cancel('quiet' => 1);
+  my $error = $cust_pkg->cancel( 'quiet' => 1,
+                                 'date'  => $p->{'date'},
+                               );
   return { 'error' => $error };
-
 }
 
 sub provision_phone {
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 0d49a28..e902100 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -1269,7 +1269,7 @@ following keys:
 =item bill_date
 
 (Future) Bill date.  Indicates a future date for which billing could be run.
-Specified as a integer UNIX timestamp.  Pass this value to the B<order_renew>
+Specified as an integer UNIX timestamp.  Pass this value to the B<order_renew>
 function.
 
 =item bill_date_pretty
@@ -1285,7 +1285,7 @@ Base amount which will be charged if renewed early as of this date.
 
 Renewal date; i.e. even-futher future date at which the customer will be paid
 through if the early renewal is completed with the given B<bill-date>.
-Specified as a integer UNIX timestamp.
+Specified as an integer UNIX timestamp.
 
 =item renew_date_pretty
 
@@ -1346,6 +1346,11 @@ Session identifier
 
 pkgpart of package to cancel
 
+=item date
+
+Optional date, for future cancellation (expiration) instead of immediate
+cancellation.  Specified as an integer UNIX timestamp ("epoch time").
+
 =back
 
 Returns a hash reference with a single key, B<error>, empty on success, or an

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                 |    7 +++----
 fs_selfservice/FS-SelfService/SelfService.pm |    9 +++++++--
 2 files changed, 10 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list