diff options
Diffstat (limited to 'fs_selfservice/php')
-rw-r--r-- | fs_selfservice/php/freeside.class.php | 34 | ||||
-rw-r--r-- | fs_selfservice/php/freeside.login_example.php | 37 | ||||
-rw-r--r-- | fs_selfservice/php/freeside_order_pkg_example.php | 38 | ||||
-rw-r--r-- | fs_selfservice/php/freeside_signup_example.php | 49 | ||||
-rw-r--r-- | fs_selfservice/php/login.php | 90 | ||||
-rw-r--r-- | fs_selfservice/php/main.php | 39 | ||||
-rw-r--r-- | fs_selfservice/php/order_renew.php | 166 | ||||
-rw-r--r-- | fs_selfservice/php/process_login.php | 38 | ||||
-rw-r--r-- | fs_selfservice/php/process_payment_order_renew.php | 74 |
9 files changed, 0 insertions, 565 deletions
diff --git a/fs_selfservice/php/freeside.class.php b/fs_selfservice/php/freeside.class.php deleted file mode 100644 index bb2ac98ee..000000000 --- a/fs_selfservice/php/freeside.class.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -class FreesideSelfService { - - //Change this to match the location of your selfservice xmlrpc.cgi or daemon - #var $URL = 'https://localhost/selfservice/xmlrpc.cgi'; - var $URL = 'http://localhost/selfservice/xmlrpc.cgi'; - - function FreesideSelfService() { - $this; - } - - public function __call($name, $arguments) { - - error_log("[FreesideSelfService] $name called, sending to ". $this->URL); - - $request = xmlrpc_encode_request("FS.SelfService.XMLRPC.$name", $arguments); - $context = stream_context_create( array( 'http' => array( - 'method' => "POST", - 'header' => "Content-Type: text/xml", - 'content' => $request - ))); - $file = file_get_contents($this->URL, false, $context); - $response = xmlrpc_decode($file); - if (xmlrpc_is_fault($response)) { - trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])"); - } else { - //error_log("[FreesideSelfService] $response"); - return $response; - } - } - -} - -?> diff --git a/fs_selfservice/php/freeside.login_example.php b/fs_selfservice/php/freeside.login_example.php deleted file mode 100644 index 69174a40a..000000000 --- a/fs_selfservice/php/freeside.login_example.php +++ /dev/null @@ -1,37 +0,0 @@ -<? - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$domain = 'example.com'; - -$response = $freeside->login( array( - 'username' => strtolower($_POST['username']), - 'domain' => $domain, - 'password' => strtolower($_POST['password']), -) ); - -error_log("[login] received response from freeside: $response"); -$error = $response['error']; - -if ( ! $error ) { - - // sucessful login - - $session_id = $response['session_id']; - - error_log("[login] logged into freeside with session_id=$session_id"); - - // store session id in your session store, to be used for other calls - -} else { - - // unsucessful login - - error_log("[login] error logging into freeside: $error"); - - // display error message to user - -} - -?> diff --git a/fs_selfservice/php/freeside_order_pkg_example.php b/fs_selfservice/php/freeside_order_pkg_example.php deleted file mode 100644 index 395ad1199..000000000 --- a/fs_selfservice/php/freeside_order_pkg_example.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$response = $freeside->order_pkg( array( - 'session_id' => $_POST['session_id'], - 'pkgpart' => 15, #Freesize 25 - #if needed# 'svcpart' => - 'id' => $_POST['id'], #unique integer ID - 'name' => $_POST['name'], #text name -) ); - -$error = $response['error']; - -if ( ! $error ) { - - // sucessful order - - $pkgnum = $response['pkgnum']; - $svcnum = $response['svcnum']; - - error_log("[order_pkg] package ordered pkgnum=$pkgnum, svcnum=$svcnum"); - - // store svcnum, to be used for the customer_status call - -} else { - - // unsucessful order - - error_log("[order_pkg] error ordering package: $error"); - - // display error message to user - -} - - -?> diff --git a/fs_selfservice/php/freeside_signup_example.php b/fs_selfservice/php/freeside_signup_example.php deleted file mode 100644 index 8b1dc193c..000000000 --- a/fs_selfservice/php/freeside_signup_example.php +++ /dev/null @@ -1,49 +0,0 @@ -<? - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$response = $freeside->new_customer( array( - 'agentnum' => 1, - - 'first' => $_POST['first'], - 'last' => $_POST['last'], - 'address1' => $_POST['address1'], - 'address2' => $_POST['address2'], - 'city' => $_POST['city'], - 'state' => $_POST['state'], - 'zip' => $_POST['zip'], - 'country' => 'US', - 'daytime' => $_POST['daytime'], - 'fax' => $_POST['fax'], - - 'payby' => 'BILL', - 'invoicing_list' => $_POST['email'], - - 'pkgpart' => 2, - 'username' => strtolower($_POST['username']), - '_password' => strtolower($_POST['password']) -) ); - -error_log("[new_customer] received response from freeside: $response"); -$error = $response['error']; - -if ( ! $error ) { - - // sucessful signup - - $custnum = $response['custnum']; - - error_log("[new_customer] signup up with custnum $custnum"); - -} else { - - // unsucessful signup - - error_log("[new_customer] signup error:: $error"); - - // display error message to user - -} - -?> diff --git a/fs_selfservice/php/login.php b/fs_selfservice/php/login.php deleted file mode 100644 index d9609147e..000000000 --- a/fs_selfservice/php/login.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$login_info = $freeside->login_info(); - -extract($login_info); - -$error = $_GET['error']; -if ( $error ) { - $username = $_GET['username']; - $domain = $_GET['domain']; -} - -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML><HEAD><TITLE>Login</TITLE></HEAD> -<BODY BGCOLOR="#e8e8e8"><FONT SIZE=5>Login</FONT><BR><BR> -<FONT SIZE="+1" COLOR="#ff0000"><?php echo htmlspecialchars($error); ?></FONT> - -<FORM ACTION="process_login.php" METHOD=POST> -<INPUT TYPE="hidden" NAME="session" VALUE="login"> - -<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0> - -<TR> - <TH ALIGN="right">Username </TH> - <TD> - <INPUT TYPE="text" NAME="username" VALUE="<?php echo htmlspecialchars($username); ?>"><?php if ( $single_domain ) { echo '@'.$single_domain; } ?> - </TD> -</TR> - -<?php if ( $single_domain ) { ?> - - <INPUT TYPE="hidden" NAME="domain" VALUE="<?php echo $single_domain ?>"> - -<?php } else { ?> - - <TR> - <TH ALIGN="right">Domain </TH> - <TD> - <INPUT TYPE="text" NAME="domain" VALUE="<?php echo htmlspecialchars($domain); ?>"> - </TD> - </TR> - -<?php } ?> - -<TR> - <TH ALIGN="right">Password </TH> - <TD> - <INPUT TYPE="password" NAME="password"> - </TD> -</TR> -<TR> - <TD COLSPAN=2 ALIGN="center"><INPUT TYPE="submit" VALUE="Login"></TD> -</TR> -</TABLE> -</FORM> - -<?php if ( $phone_login ) { ?> - - <B>OR</B><BR><BR> - - <FORM ACTION="process_login.php" METHOD=POST> - <INPUT TYPE="hidden" NAME="session" VALUE="login"> - <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0> - <TR> - <TH ALIGN="right">Phone number </TH> - <TD> - <INPUT TYPE="text" NAME="username" VALUE="<?php echo htmlspecialchars($username) ?>"> - </TD> - </TR> - <INPUT TYPE="hidden" NAME="domain" VALUE="svc_phone"> - <TR> - <TH ALIGN="right">PIN </TH> - <TD> - <INPUT TYPE="password" NAME="password"> - </TD> - </TR> - <TR> - <TD COLSPAN=2 ALIGN="center"><INPUT TYPE="submit" VALUE="Login"></TD> - </TR> - </TABLE> - </FORM> - -<?php } ?> - -</BODY></HTML> - diff --git a/fs_selfservice/php/main.php b/fs_selfservice/php/main.php deleted file mode 100644 index b34a47730..000000000 --- a/fs_selfservice/php/main.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$session_id = $_GET['session_id']; - -$response = $freeside->customer_info( array( - 'session_id' => $session_id, -) ); - -$error = $response['error']; - -if ( $error ) { - header('Location:login.php?error='. urlencode($error)); - die(); -} - -extract($response); - -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> - <HEAD> - <TITLE>My Account</TITLE> - </HEAD> - <BODY> - <H1>My Account</H1> - - Hello, <?php echo htmlspecialchars($name); ?><BR><BR> - - <?php echo $small_custview; ?> - - <BR> - - <A HREF="order_renew.php?session_id=<?php echo $session_id; ?>">Renew early</A> - - </BODY> -</HTML> diff --git a/fs_selfservice/php/order_renew.php b/fs_selfservice/php/order_renew.php deleted file mode 100644 index e74ba40af..000000000 --- a/fs_selfservice/php/order_renew.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$session_id = $_GET['session_id']; - -$renew_info = $freeside->renew_info( array( - 'session_id' => $session_id, -) ); - -$error = $renew_info['error']; - -if ( $error ) { - header('Location:login.php?error='. urlencode($error)); - die(); -} - -#in the simple case, just deal with the first package -$bill_date = $renew_info['dates'][0]['bill_date']; -$bill_date_pretty = $renew_info['dates'][0]['bill_date_pretty']; -$renew_date = $renew_info['dates'][0]['renew_date']; -$renew_date_pretty = $renew_info['dates'][0]['renew_date_pretty']; -$amount = $renew_info['dates'][0]['amount']; - -$payment_info = $freeside->payment_info( array( - 'session_id' => $session_id, -) ); - -extract($payment_info); - -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> - <HEAD> - <TITLE>Renew Early</TITLE> - </HEAD> - <BODY> - <H1>Renew Early</H1> - - <FONT SIZE="+1" COLOR="#ff0000"><?php echo htmlspecialchars($_GET['error']); ?></FONT> - - <FORM NAME="OneTrueForm" METHOD="POST" ACTION="process_payment_order_renew.php" onSubmit="document.OneTrueForm.process.disabled=true"> - - <INPUT TYPE="hidden" NAME="date" VALUE="<?php echo $date; ?>"> - <INPUT TYPE="hidden" NAME="session_id" VALUE="<?php echo $session_id; ?>"> - <INPUT TYPE="hidden" NAME="amount" VALUE="<?php echo $amount; ?>"> - - A payment of $<?php echo $amount; ?> will renew your account through <?php echo $renew_date_pretty; ?>.<BR><BR> - - <TABLE BGCOLOR="#cccccc"> - <TR> - <TD ALIGN="right">Amount</TD> - <TD> - <TABLE><TR><TD BGCOLOR="#ffffff"> - $<?php echo $amount; ?> - </TD></TR></TABLE> - </TD> - </TR> - <TR> - <TD ALIGN="right">Card type</TD> - <TD> - <SELECT NAME="card_type"><OPTION></OPTION> - <?php foreach ( array_keys($card_types) as $t ) { ?> - <OPTION <?php if ($card_type == $card_types[$t] ) { ?> SELECTED <?php } ?> - VALUE="<?php echo $card_types[$t]; ?>" - ><?php echo $t; ?> - <?php } ?> - </SELECT> - </TD> - </TR> - - <TR> - <TD ALIGN="right">Card number</TD> - <TD> - <TABLE> - <TR> - <TD> - <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<?php echo $payinfo; ?>"> </TD> - <TD>Exp.</TD> - <TD> - <SELECT NAME="month"> - <?php foreach ( array('01','02','03','04','05','06','07','08','09','10','11','12') as $m) { ?> - <OPTION<?php if ($m == $month ) { ?> SELECTED<?php } ?> - ><?php echo $m; ?> - <?php } ?> - </SELECT> - </TD> - <TD> / </TD> - <TD> - <SELECT NAME="year"> - <?php $lt = localtime(); $y = $lt[5] + 1900; - for ($y = $lt[5]+1900; $y < $lt[5] + 1910; $y++ ) { ?> - <OPTION<?php if ($y == $year ) { ?> SELECTED<?php } ?> - ><?php echo $y; ?> - <?php } ?> - </SELECT> - </TD> - </TR> - </TABLE> - </TD> - </TR> - <?php if ( $withcvv ) { ?> - <TR> - <TD ALIGN="right">CVV2 (<A HREF="javascript:myopen('cvv2.html','cvv2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=288')">help</A>)</TD> - <TD><INPUT TYPE="text" NAME="paycvv" VALUE="" SIZE=4 MAXLENGTH=4></TD> - </TR> - <?php } ?> - <TR> - <TD ALIGN="right">Exact name on card</TD> - <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<?php echo $payname; ?>"></TD> - </TR><TR> - <TD ALIGN="right">Card billing address</TD> - <TD> - <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address1" VALUE="<?php echo $address1; ?>"> - </TD> - </TR><TR> - <TD ALIGN="right">Address line 2</TD> - <TD> - <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address2" VALUE="<?php echo $address2; ?>"> - </TD> - </TR><TR> - <TD ALIGN="right">City</TD> - <TD> - <TABLE> - <TR> - <TD> - <INPUT TYPE="text" NAME="city" SIZE="12" MAXLENGTH=80 VALUE="<?php echo $city; ?>"> - </TD> - <TD>State</TD> - <TD> - <SELECT NAME="state"> - <?php foreach ( $states as $s ) { ?> - <OPTION<?php if ($s == $state) { ?> SELECTED<?php } ?> - ><?php echo $s; ?> - <?php } ?> - </SELECT> - </TD> - <TD>Zip</TD> - <TD> - <INPUT TYPE="text" NAME="zip" SIZE=11 MAXLENGTH=10 VALUE="<?php echo $zip; ?>"> - </TD> - </TR> - </TABLE> - </TD> - </TR> - - <TR> - <TD COLSPAN=2> - <INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1"> - Remember this information - </TD> - </TR><TR> - <TD COLSPAN=2> - <INPUT TYPE="checkbox"<?php if ( $payby == 'CARD' ) { ?> CHECKED<?php } ?> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }"> - Charge future payments to this card automatically - </TD> - </TR> - </TABLE> - <BR> - <INPUT TYPE="hidden" NAME="paybatch" VALUE="<?php echo $paybatch; ?>"> - <INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> --> - </FORM> - - </BODY> -</HTML> diff --git a/fs_selfservice/php/process_login.php b/fs_selfservice/php/process_login.php deleted file mode 100644 index 1f4fd9a6b..000000000 --- a/fs_selfservice/php/process_login.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$response = $freeside->login( array( - 'username' => strtolower($_POST['username']), - 'domain' => strtolower($_POST['domain']), - 'password' => strtolower($_POST['password']), -) ); - -#error_log("[login] received response from freeside: $response"); - -$error = $response['error']; - -if ( $error ) { - - header('Location:login.php?username='. urlencode($username). - '&domain='. urlencode($domain). - '&error='. urlencode($error) - ); - die(); - -} - -// sucessful login - -$session_id = $response['session_id']; - -#error_log("[login] logged into freeside with session_id=$session_id"); - -// now what? for now, always redirect to the main page. -// eventually, other options? - -header("Location:main.php?session_id=$session_id") -#die(); - -?> diff --git a/fs_selfservice/php/process_payment_order_renew.php b/fs_selfservice/php/process_payment_order_renew.php deleted file mode 100644 index 20594624b..000000000 --- a/fs_selfservice/php/process_payment_order_renew.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -require('freeside.class.php'); -$freeside = new FreesideSelfService(); - -$response = $freeside->process_payment_order_renew( array( - 'session_id' => $_POST['session_id'], - 'payby' => 'CARD', - 'amount' => $_POST['amount'], - 'payinfo' => $_POST['payinfo'], - 'paycvv' => $_POST['paycvv'], - 'month' => $_POST['month'], - 'year' => $_POST['year'], - 'payname' => $_POST['payname'], - 'address1' => $_POST['address1'], - 'address2' => $_POST['address2'], - 'city' => $_POST['city'], - 'state' => $_POST['state'], - 'zip' => $_POST['zip'], - 'save' => $_POST['save'], - 'auto' => $_POST['auto'], - 'paybatch' => $_POST['paybatch'], -) ); - -error_log("[process_payment_order_renew] received response from freeside: $response"); - -$error = $response['error']; - -if ( $error ) { - - error_log("[process_payment_order_renew] response error: $error"); - - header('Location:order_renew.php'. - '?session_id='. urlencode($_POST['session_id']). - '?error='. urlencode($error). - '&payby=CARD'. - '&amount='. urlencode($_POST['amount']). - '&payinfo='. urlencode($_POST['payinfo']). - '&paycvv='. urlencode($_POST['paycvv']). - '&month='. urlencode($_POST['month']). - '&year='. urlencode($_POST['year']). - '&payname='. urlencode($_POST['payname']). - '&address1='. urlencode($_POST['address1']). - '&address2='. urlencode($_POST['address2']). - '&city='. urlencode($_POST['city']). - '&state='. urlencode($_POST['state']). - '&zip='. urlencode($_POST['zip']). - '&save='. urlencode($_POST['save']). - '&auto='. urlencode($_POST['auto']). - '&paybatch='. urlencode($_POST['paybatch']) - ); - die(); - -} - -// sucessful renewal. - -$session_id = $response['session_id']; - -// now what? - -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> - <HEAD> - <TITLE>Renew Early</TITLE> - </HEAD> - <BODY> - <H1>Renew Early</H1> - - Renewal processed sucessfully. - - </BODY> -</HTML> |