调试支付回调

This commit is contained in:
liu 2024-06-05 10:36:46 +08:00
parent 73daf982ae
commit f12b537d71
2 changed files with 3 additions and 3 deletions

View File

@ -6,6 +6,7 @@ use app\common\enum\PayEnum;
use app\common\logic\PayNotifyLogic;
use app\common\model\retail\Cashierclass;
use app\common\service\pay\PayService;
use support\Cache;
use support\Log;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\NotParse()]
@ -27,8 +28,8 @@ class PayController extends BaseApiController
{
$app = new PayService(1);
$result = $app->wechat->callback(Request()->post());
Log::info(json_decode($result,true));
Log::info($result);
Cache::set('log'.time(),$result);
Cache::set('logJ'.time(),json_encode($result));
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
$ciphertext = $result->resource['ciphertext'];
if ($ciphertext['trade_state'] === 'SUCCESS') {

View File

@ -52,7 +52,6 @@ class PayService extends BasePayService
{
$this->terminal = $terminal;
$config = Config::get('payment');
$config['wechat']['default']['notify_url'] = 'https://test-admin-multi-store.lihaink.cn'.$config['wechat']['default']['notify_url'];
Pay::config($config);
if ($userId !== null) {
$this->auth = UserAuth::where(['user_id' => $userId, 'terminal' => $terminal])->findOrEmpty();