reportParams = $reportParams; $this->url = env('TIKTOK_API_URL'). 'api/qappuser/charge'; } /** * Execute the job. * @throws \GuzzleHttp\Exception\GuzzleException */ public function handle() { $client = new Client(); $params = [ 'uid' => (int)$this->reportParams->uid, 'amount' => (float)$this->reportParams->amount, 'pay_time' => (string)$this->reportParams->pay_time, 'type' => (string)$this->reportParams->type, 'book_id' => (string)$this->reportParams->book_id, 'book_name' => (string)$this->reportParams->book_name, 'molecule' => (int)$this->reportParams->molecule, 'denominator' => (int)$this->reportParams->denominator, 'source' => 'zsy', 'send_order_id' => $this->reportParams->send_order_id, ]; $params['sign'] = _sign($params, SysConsts::TIKTOK_KEY); $response = $client->request('post', $this->url, ['form_params' => $params])->getBody()->getContents(); myLog('qapp_user_charge')->info($response); $result = json_decode($response); if ($result) { if ($result->code != 0) { myLog('qapp_user_charge')->info($response); } } } }