reportParams = $reportParams; $this->url = env('TIKTOK_API_URL'). 'api/qappuser/new_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, 'order_no' => (string)$this->reportParams->order_no, 'book_id' => (string)$this->reportParams->book_id, 'book_name' => (string)$this->reportParams->book_name, 'source' => 'zsy', ]; // 避免签名错误 if ($this->reportParams->send_order_id) { $params['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); } } } }