Save client info on upgrade
This commit is contained in:
parent
40f2796972
commit
01bf2883e5
|
@ -15,7 +15,6 @@ class BillingController extends Zend_Controller_Action {
|
||||||
//$formData = $form->getValues();
|
//$formData = $form->getValues();
|
||||||
$formData = $request->getPost();
|
$formData = $request->getPost();
|
||||||
if ($form->isValid($formData)) {
|
if ($form->isValid($formData)) {
|
||||||
|
|
||||||
$credentials = self::getAPICredentials();
|
$credentials = self::getAPICredentials();
|
||||||
|
|
||||||
$postfields = array();
|
$postfields = array();
|
||||||
|
@ -33,15 +32,36 @@ class BillingController extends Zend_Controller_Action {
|
||||||
$postfields["paymentmethod"] = $formData["paymentmethod"];
|
$postfields["paymentmethod"] = $formData["paymentmethod"];
|
||||||
$postfields["responsetype"] = "json";
|
$postfields["responsetype"] = "json";
|
||||||
|
|
||||||
$query_string = "";
|
$upgrade_query_string = "";
|
||||||
foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&";
|
foreach ($postfields AS $k=>$v) $upgrade_query_string .= "$k=".urlencode($v)."&";
|
||||||
|
|
||||||
//update client info
|
//update client info
|
||||||
|
$clientfields = array();
|
||||||
|
$clientfields["username"] = $credentials["username"];
|
||||||
|
$clientfields["password"] = md5($credentials["password"]);
|
||||||
|
$clientfields["action"] = "updateclient";
|
||||||
|
//$clientfields["clientid"] = Application_Model_Preference::GetClientId();
|
||||||
|
$clientfields["clientid"] = 1846;
|
||||||
|
$clientfields["responsetype"] = "json";
|
||||||
|
unset($formData["newproductid"]);
|
||||||
|
unset($formData["newproductbillingcycle"]);
|
||||||
|
unset($formData["paymentmethod"]);
|
||||||
|
unset($formData["action"]);
|
||||||
|
$clientfields = array_merge($clientfields, $formData);
|
||||||
|
unset($clientfields["password2verify"]);
|
||||||
|
unset($clientfields["submit"]);
|
||||||
|
$client_query_string = "";
|
||||||
|
foreach ($clientfields AS $k=>$v) $client_query_string .= "$k=".urlencode($v)."&";
|
||||||
|
|
||||||
|
$result = $this->makeRequest($credentials["url"], $client_query_string);
|
||||||
//$result = $this->makeRequest($credentials["url"], $query_string);
|
if ($result["result"] == "error") {
|
||||||
//self::viewInvoice($result["invoiceid"]);
|
$this->view->errorMessage = "An error occurred and we could not upgrade your account. Please contact support for help";
|
||||||
self::viewInvoice(5108);
|
$this->view->form = $form;
|
||||||
|
} else {
|
||||||
|
//$result = $this->makeRequest($credentials["url"], $upgrade_query_string);
|
||||||
|
//self::viewInvoice($result["invoiceid"]);
|
||||||
|
self::viewInvoice(5108);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong">
|
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong">
|
||||||
<?php //echo $this->successMessage ?>
|
<?php if (isset($this->errorMessage)) {?>
|
||||||
|
<div class="errors"><?php echo $this->errorMessage ?></div>
|
||||||
|
<?php }?>
|
||||||
<div>Plan Level: <?php echo Application_Model_Preference::GetPlanLevel();?></div>
|
<div>Plan Level: <?php echo Application_Model_Preference::GetPlanLevel();?></div>
|
||||||
<?php echo $this->form ?>
|
<?php echo $this->form ?>
|
||||||
<br><br><br><br>
|
<br><br><br><br>
|
||||||
|
|
Loading…
Reference in New Issue