- 0
After using admin ChangePackage getting blank with no errors
-
Recently Browsing 0 members
- No registered users viewing this page.
By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated
Question
Alrex82
here's a before and after shot of using change package button
and hers the function:
function taptacarte_ChangePassword( $params ){
try {
$data = json_encode(array(
'email' => $params['clientsdetails']['email'],
'subscriptionid' => $params['subscriptionid'],
));
$url = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$cURLConnection = curl_init($url);
curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $data);
curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: Header-Value',
'Authorization: Bearer XXXXXXXXXXXXXXXXXX',
));
$apiResponse = curl_exec($cURLConnection);
curl_close($cURLConnection);
$json = json_decode($apiResponse);
if($json->user_pass == "error"){
throw new Exception('Error from server');
}else{
$params['model']->serviceProperties->save(['Password' => $json->user_pass]);
}
} catch (Exception $e) {
logModuleCall(
'taptacarte',
__FUNCTION__,
$params,
$e->getMessage(),
$e->getTraceAsString()
);
return $e->getMessage();
}
return 'success';
}
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.