调试支付回调
This commit is contained in:
parent
73daf982ae
commit
f12b537d71
@ -6,6 +6,7 @@ use app\common\enum\PayEnum;
|
|||||||
use app\common\logic\PayNotifyLogic;
|
use app\common\logic\PayNotifyLogic;
|
||||||
use app\common\model\retail\Cashierclass;
|
use app\common\model\retail\Cashierclass;
|
||||||
use app\common\service\pay\PayService;
|
use app\common\service\pay\PayService;
|
||||||
|
use support\Cache;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
use hg\apidoc\annotation as ApiDoc;
|
use hg\apidoc\annotation as ApiDoc;
|
||||||
#[ApiDoc\NotParse()]
|
#[ApiDoc\NotParse()]
|
||||||
@ -27,8 +28,8 @@ class PayController extends BaseApiController
|
|||||||
{
|
{
|
||||||
$app = new PayService(1);
|
$app = new PayService(1);
|
||||||
$result = $app->wechat->callback(Request()->post());
|
$result = $app->wechat->callback(Request()->post());
|
||||||
Log::info(json_decode($result,true));
|
Cache::set('log'.time(),$result);
|
||||||
Log::info($result);
|
Cache::set('logJ'.time(),json_encode($result));
|
||||||
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
||||||
$ciphertext = $result->resource['ciphertext'];
|
$ciphertext = $result->resource['ciphertext'];
|
||||||
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
||||||
|
@ -52,7 +52,6 @@ class PayService extends BasePayService
|
|||||||
{
|
{
|
||||||
$this->terminal = $terminal;
|
$this->terminal = $terminal;
|
||||||
$config = Config::get('payment');
|
$config = Config::get('payment');
|
||||||
$config['wechat']['default']['notify_url'] = 'https://test-admin-multi-store.lihaink.cn'.$config['wechat']['default']['notify_url'];
|
|
||||||
Pay::config($config);
|
Pay::config($config);
|
||||||
if ($userId !== null) {
|
if ($userId !== null) {
|
||||||
$this->auth = UserAuth::where(['user_id' => $userId, 'terminal' => $terminal])->findOrEmpty();
|
$this->auth = UserAuth::where(['user_id' => $userId, 'terminal' => $terminal])->findOrEmpty();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user