|
@@ -154,7 +154,7 @@ class CregisPayService extends BaseService
|
|
|
$callback = self::$config['callUrl'];
|
|
$callback = self::$config['callUrl'];
|
|
|
$tokenAddress = ConfigService::make()->getConfigByCode('solana_usdt_token', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB');
|
|
$tokenAddress = ConfigService::make()->getConfigByCode('solana_usdt_token', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB');
|
|
|
$coinType = $coinType ? $coinType : $tokenAddress;
|
|
$coinType = $coinType ? $coinType : $tokenAddress;
|
|
|
- RedisService::set("caches:cregisPay:withdraw_{$orderNo}", ['callback'=> $callback,'order_no'=>$orderNo,'amount'=>$amount,'remark'=>$remark,'mainType'=>$mainCoinType,'coinType'=>$address],7200);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:{$orderNo}:withdraw", ['callback'=> $callback,'order_no'=>$orderNo,'amount'=>$amount,'remark'=>$remark,'mainType'=>$mainCoinType,'coinType'=>$address],7200);
|
|
|
return $this->dispatch->payout(self::$config['project_no'], $mainCoinType . '@' . $coinType, $address, $amount, $callback, $orderNo, time(), $remark);
|
|
return $this->dispatch->payout(self::$config['project_no'], $mainCoinType . '@' . $coinType, $address, $amount, $callback, $orderNo, time(), $remark);
|
|
|
} catch (\Exception $exception) {
|
|
} catch (\Exception $exception) {
|
|
|
$this->error = $exception->getMessage();
|
|
$this->error = $exception->getMessage();
|
|
@@ -185,7 +185,7 @@ class CregisPayService extends BaseService
|
|
|
{
|
|
{
|
|
|
$result = $this->dispatch->changeBackUrl();
|
|
$result = $this->dispatch->changeBackUrl();
|
|
|
|
|
|
|
|
- RedisService::set("caches:cregisPay:recharge_callback", ['params' => request()->all(), 'result' => $result], 3600);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:recharge:callback", ['params' => request()->all(), 'result' => $result], 3600);
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -198,15 +198,15 @@ class CregisPayService extends BaseService
|
|
|
$data = file_get_contents('php://input');
|
|
$data = file_get_contents('php://input');
|
|
|
$params = $data?json_decode($data, true) : [];
|
|
$params = $data?json_decode($data, true) : [];
|
|
|
if(empty($params)){
|
|
if(empty($params)){
|
|
|
- RedisService::set("caches:withdraw:data_".date('YmdHis'),['params'=> $params,'data'=> $data], 3600);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:data_".date('YmdHis'),['params'=> $params,'data'=> $data], 3600);
|
|
|
return 'Callback data error';
|
|
return 'Callback data error';
|
|
|
}
|
|
}
|
|
|
$getSign = $params['sign'];
|
|
$getSign = $params['sign'];
|
|
|
$orderNo = isset($params['third_party_id'])? trim($params['third_party_id']) : '';
|
|
$orderNo = isset($params['third_party_id'])? trim($params['third_party_id']) : '';
|
|
|
$sgin = $this->dispatch->generateSign(self::$config['api_key'], $params);
|
|
$sgin = $this->dispatch->generateSign(self::$config['api_key'], $params);
|
|
|
- RedisService::set("caches:withdraw:{$orderNo}_callback", ['params' => request()->all(), 'result' => $params], 7200);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:{$orderNo}:callback", ['params' => request()->all(), 'result' => $params], 7200);
|
|
|
if($getSign!=$sgin){
|
|
if($getSign!=$sgin){
|
|
|
- RedisService::set("caches:withdraw:{$orderNo}_signCheck",['params'=> request()->all(),'result'=> $params], 3600);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:{$orderNo}:signCheck",['params'=> request()->all(),'result'=> $params], 3600);
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
$payStatus = $params['status'] == 0 || $params['status'] == 6? 20 : 30;
|
|
$payStatus = $params['status'] == 0 || $params['status'] == 6? 20 : 30;
|
|
@@ -227,12 +227,12 @@ class CregisPayService extends BaseService
|
|
|
$updateData['pay_at'] = date('Y-m-d H:i:s');
|
|
$updateData['pay_at'] = date('Y-m-d H:i:s');
|
|
|
}
|
|
}
|
|
|
if(!BalanceLogModel::where(['order_no'=> $orderNo,'trade_cid'=> $tradeCid,'mark'=>1])->update($updateData)){
|
|
if(!BalanceLogModel::where(['order_no'=> $orderNo,'trade_cid'=> $tradeCid,'mark'=>1])->update($updateData)){
|
|
|
- RedisService::set("caches:withdraw:{$orderNo}_failed", ['params' => request()->all(),'data'=>$updateData, 'result' => $params], 7200);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:{$orderNo}:failed", ['params' => request()->all(),'data'=>$updateData, 'result' => $params], 7200);
|
|
|
$this->error = 2034;
|
|
$this->error = 2034;
|
|
|
return '';
|
|
return '';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- RedisService::set("caches:withdraw:{$orderNo}:success", ['params' => request()->all(),'data'=>$updateData, 'result' => $params], 7200);
|
|
|
|
|
|
|
+ RedisService::set("caches:cregisPay:{$orderNo}:success", ['params' => request()->all(),'data'=>$updateData, 'result' => $params], 7200);
|
|
|
return 'success';
|
|
return 'success';
|
|
|
}
|
|
}
|
|
|
|
|
|