Jump to content
  • 0

After using admin ChangePackage getting blank with no errors


Alrex82

Question

here's a before and after shot of using change package button

Screenshot%202023-11-07%20170426.pngScreenshot%202023-11-07%20170551.png

 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

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated