Jump to content

Alrex82

New Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Alrex82

  1. 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'; }
×
×
  • 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