|
@@ -45,7 +45,7 @@ class CregisPayService extends BaseService
|
|
|
'project_no' => isset($config['cregis_project_no']['value']) ? $config['cregis_project_no']['value'] : '', //商户号
|
|
|
'api_key' => isset($config['cregis_api_key']['value']) ? $config['cregis_api_key']['value'] : '', //apikey
|
|
|
'endpoint' => isset($config['cregis_endpoint']['value']) ? $config['cregis_endpoint']['value'] : '', //节点
|
|
|
- 'callUrl' => url($notifyUrl, '', true), //回调地址
|
|
|
+ 'callUrl' => env('APP_URL').'/'.trim($notifyUrl,'/'), //回调地址
|
|
|
'debug' => false //调试模式
|
|
|
];
|
|
|
|
|
@@ -109,7 +109,7 @@ class CregisPayService extends BaseService
|
|
|
public function createAddress($mainCoinType = '1000')
|
|
|
{
|
|
|
try {
|
|
|
- $callback = url(self::$rechargeNotifyUrl, '', true);
|
|
|
+ $callback = env('APP_URL').'/'.trim(self::$rechargeNotifyUrl,'/');
|
|
|
$result = $this->dispatch->createAddress(self::$config['project_no'], $mainCoinType, '', $callback);
|
|
|
$code = isset($result['code']) ? trim($result['code']) : 0;
|
|
|
$address = isset($result['data']['address']) ? trim($result['data']['address']) : '';
|
|
@@ -167,7 +167,7 @@ class CregisPayService extends BaseService
|
|
|
public function withdraw($address, $amount, $orderNo, $mainCoinType = '1000', $coinType = '', $remark = '')
|
|
|
{
|
|
|
try {
|
|
|
- $callback = self::$config['callUrl'];
|
|
|
+ $callback = env('APP_URL').'/'.trim(self::$config['callUrl'],'/');
|
|
|
$tokenAddress = ConfigService::make()->getConfigByCode('solana_usdt_token', 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB');
|
|
|
$coinType = $coinType ? $coinType : $tokenAddress;
|
|
|
RedisService::set("caches:cregisPay:{$orderNo}:withdraw", ['callback'=> $callback,'order_no'=>$orderNo,'amount'=>$amount,'remark'=>$remark,'address'=>$address,'mainType'=>$mainCoinType,'coinType'=>$coinType],7200);
|
|
@@ -412,6 +412,8 @@ class CregisPayService extends BaseService
|
|
|
}
|
|
|
$getSign = $params['sign'];
|
|
|
$orderNo = isset($params['third_party_id'])? trim($params['third_party_id']) : '';
|
|
|
+ $tradeCid = isset($params['cid'])? trim($params['cid']) : '';
|
|
|
+ $orderNo = $orderNo? $orderNo : $tradeCid;
|
|
|
$sgin = $this->dispatch->generateSign(self::$config['api_key'], $params);
|
|
|
RedisService::set("caches:cregisPay:withdraw_{$orderNo}:callback", ['params' => request()->all(), 'result' => $params], 7200);
|
|
|
if($getSign!=$sgin){
|
|
@@ -429,7 +431,6 @@ class CregisPayService extends BaseService
|
|
|
}
|
|
|
|
|
|
|
|
|
- $tradeCid = isset($params['cid'])? trim($params['cid']) : '';
|
|
|
$txid = isset($params['txid'])? trim($params['txid']) : '';
|
|
|
$updateData = ['pay_status'=> $payStatus,'hash'=>$txid,'remark'=> $remark];
|
|
|
if($payStatus == 20){
|