[freeside-commits] branch master updated. 810e6898f2cc89911edd5a56e90ddb202867c92a

Christopher Burger burgerc at 420.am
Thu Jul 27 09:53:45 PDT 2017


The branch, master has been updated
       via  810e6898f2cc89911edd5a56e90ddb202867c92a (commit)
      from  fed350a1aa758b095ca220a798939733b774dcc5 (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 810e6898f2cc89911edd5a56e90ddb202867c92a
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Jul 27 12:53:59 2017 -0400

    RT# 76905 - Created ability to delete payment account thru NG selfservice to test API change in ticket 74537

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 5c86b78..99c5f74 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -152,6 +152,7 @@ sub skin_info {
 
                  personal.php Profile
                  personal.php Personal Information
+                 payment_accounts.php Payment Accounts
                  password.php Change Password
 
                  payment.php Payments
diff --git a/ng_selfservice/payment_accounts.php b/ng_selfservice/payment_accounts.php
new file mode 100644
index 0000000..e70142a
--- /dev/null
+++ b/ng_selfservice/payment_accounts.php
@@ -0,0 +1,78 @@
+<? $title ='Payment Accounts'; include('elements/header.php'); ?>
+<? $current_menu = 'payment_accounts.php'; include('elements/menu.php'); ?>
+<H1>My Payment Accounts</H1>
+<br>
+
+<?
+if ( isset($_GET['action']) && $_GET['action'] ) {
+  $action = $_GET['action'];
+}
+
+if ($action == 'deleteaccount') {
+
+    if ( isset($_GET['paybynum']) && $_GET['paybynum'] ) {
+      if ( preg_match( '/^(\d+)$/', $_GET['paybynum'] ) ) {
+        $paybynum = $_GET['paybynum'];
+        $error = $freeside->delete_payby( array(
+          'session_id' => $_COOKIE['session_id'],
+          'custpaybynum' => $paybynum,
+        ) );
+      }
+      else {
+        $error['error'] = 'Bad Payby Number';
+      }
+    }
+
+  if ( isset($error['error']) && $error['error'] ) {
+    $error = $error['error'];
+  }
+  else {
+    $error = "Account " . $paybynum . " Deleted";
+  }
+
+?>
+   <FONT COLOR="red"><? echo $error ?></FONT>
+   <P>
+<?
+}
+
+  $payment_info = $freeside->list_payby( array(
+    'session_id' => $_COOKIE['session_id'],
+  ) );
+
+  if ( isset($payment_info['error']) && $payment_info['error'] ) {
+    $error = $payment_info['error'];
+    header('Location:index.php?error='. urlencode($error));
+    die();
+  }
+
+  extract($payment_info);
+?>
+
+<TABLE>
+ <TR>
+   <TD> </TD>
+   <TD>Type</TD>
+   <TD>Account Type</TD>
+   <TD>Account Mask</TD>
+   <TD>Bank Name</TD>
+ </TR>
+
+<?
+  foreach ($payby as $payaccount) {
+?>
+    <TR>
+      <TD><A HREF="payment_accounts.php?action=deleteaccount&paybynum=<? echo $payaccount['custpaybynum'] ?>">delete</A></TD>
+      <TD><? echo $payaccount['payby'] ?></TD>
+      <TD><? echo $payaccount['paytype'] ?></TD>
+      <TD><? echo $payaccount['paymask'] ?></TD>
+      <TD><? echo htmlspecialchars($payaccount['payname']) ?></TD>
+     </TR>
+ <?
+  }
+ ?>
+
+</TABLE>
+
+<? include('elements/menu_footer.php'); ?>
+<? include('elements/footer.php'); ?>

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

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm        |    1 +
 ng_selfservice/payment_accounts.php |   78 +++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 ng_selfservice/payment_accounts.php




More information about the freeside-commits mailing list