<?php require_once './header.php'; $customer = ChargeBee_Customer::retrieve($customerId)->customer(); ?> <script src="../assets/javascript/ssp/ssp.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#update-account-info").validate(); $('#update-account-info').on('submit', ajaxHandler) }) </script> <div id="cb-wrapper-ssp"> <ul class="nav nav-tabs"> <li class="active"><a href="">Customer Information</a></li> <li class="pull-right"> <?php include "./Logout.php"; ?> </li> </ul> <div id="cb-main-content" class="clearfix"> <br> <div class="clearfix col-sm-12"> <form action ="update_account_info" method="post" id="update-account-info"> <div class="row"> <div class="col-sm-6"> <div class="form-group">
function updateBillingInfo() { header('Content-Type: application/json'); validateParameters($_POST); $customerId = getCustomerId(); $billingAddrParams = $_POST['billing_address']; try { $result = ChargeBee_Customer::updateBillingInfo($customerId, array("billing_address" => $billingAddrParams)); $jsonResponse = array("forward" => "/ssp-php/subscription"); print json_encode($jsonResponse, true); } catch (ChargeBee_InvalidRequestException $e) { handleInvalidRequestErrors($e); } catch (Exception $e) { handleGeneralErrors($e); } }