|
@@ -54,13 +54,13 @@ class QappTikTokUserCharge implements ShouldQueue
|
|
|
*/
|
|
|
public function __construct(int $uid, float $amount, string $pay_time, string $type, string $book_id, string $book_name, int $molecule = 1, int $denominator = 1)
|
|
|
{
|
|
|
- $this->uid = $uid;
|
|
|
- $this->amount = $amount;
|
|
|
- $this->pay_time = $pay_time;
|
|
|
- $this->type = $type;
|
|
|
- $this->book_id = $book_id;
|
|
|
- $this->book_name = $book_name;
|
|
|
- $this->molecule = $molecule;
|
|
|
+ $this->uid = $uid;
|
|
|
+ $this->amount = $amount;
|
|
|
+ $this->pay_time = $pay_time;
|
|
|
+ $this->type = $type;
|
|
|
+ $this->book_id = $book_id;
|
|
|
+ $this->book_name = $book_name;
|
|
|
+ $this->molecule = $molecule;
|
|
|
$this->denominator = $denominator;
|
|
|
}
|
|
|
|
|
@@ -71,22 +71,22 @@ class QappTikTokUserCharge implements ShouldQueue
|
|
|
*/
|
|
|
public function handle()
|
|
|
{
|
|
|
- $client = new Client();
|
|
|
- $params = [
|
|
|
- 'uid' => $this->uid,
|
|
|
- 'amount' => $this->amount,
|
|
|
- 'pay_time' => $this->pay_time,
|
|
|
- 'type' => $this->type,
|
|
|
- 'book_id' => $this->book_id,
|
|
|
- 'book_name' => $this->book_name,
|
|
|
- 'molecule' => $this->molecule,
|
|
|
+ $client = new Client();
|
|
|
+ $params = [
|
|
|
+ 'uid' => $this->uid,
|
|
|
+ 'amount' => $this->amount,
|
|
|
+ 'pay_time' => $this->pay_time,
|
|
|
+ 'type' => $this->type,
|
|
|
+ 'book_id' => $this->book_id,
|
|
|
+ 'book_name' => $this->book_name,
|
|
|
+ 'molecule' => $this->molecule,
|
|
|
'denominator' => $this->denominator,
|
|
|
- 'source' => 'zsy'
|
|
|
+ 'source' => 'zsy'
|
|
|
];
|
|
|
- $params['sign'] = _sign($params, SysConsts::TIKTOK_KEY);
|
|
|
- $response = $client->request('post', $this->url, ['form_params' => $params])->getBody()->getContents();
|
|
|
+ $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);
|
|
|
+ $result = json_decode($response);
|
|
|
if ($result) {
|
|
|
if ($result->code != 0) {
|
|
|
myLog('qapp_user_charge')->info($response);
|