summaryrefslogtreecommitdiff
path: root/ng_selfservice
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-08-25 15:06:19 -0700
committerIvan Kohler <ivan@freeside.biz>2017-08-25 15:06:19 -0700
commitcbfeb5f6b7490f78361318ce6290bfb442dbfcbe (patch)
treee6409692bc2376649eeda94344f0a7f578a75428 /ng_selfservice
parent8ffd7de981603a189cd0ea62ca948eaf3f66ca49 (diff)
parent5b5eb87bf66f1fac003a13dc2db48e8970c5c986 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'ng_selfservice')
-rw-r--r--ng_selfservice/payment_accounts.php78
1 files changed, 78 insertions, 0 deletions
diff --git a/ng_selfservice/payment_accounts.php b/ng_selfservice/payment_accounts.php
new file mode 100644
index 000000000..e70142a0a
--- /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>&nbsp;</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'); ?>