Merge branch 'main' of https://gitea.lihaink.cn/mkm/multi-store
This commit is contained in:
commit
cf79b9e139
@ -33,18 +33,19 @@ class PayController extends BaseApiController
|
|||||||
Cache::set('logE1'.time(),$result['event_type']??'');
|
Cache::set('logE1'.time(),$result['event_type']??'');
|
||||||
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
if ($result && $result->event_type == 'TRANSACTION.SUCCESS') {
|
||||||
$ciphertext = $result->resource['ciphertext'];
|
$ciphertext = $result->resource['ciphertext'];
|
||||||
Cache::set('logc'.time(),json_decode($result->resource['ciphertext'],true));
|
Cache::set('logc'.time(),json_encode($result->resource['ciphertext'],true));
|
||||||
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
if ($ciphertext['trade_state'] === 'SUCCESS') {
|
||||||
$attach = $ciphertext['attach'];
|
$attach = $ciphertext['attach'];
|
||||||
switch ($attach) {
|
switch ($attach) {
|
||||||
case 'wechat_common':
|
|
||||||
PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext);
|
|
||||||
$app->wechat->success();
|
|
||||||
break;
|
|
||||||
case 'recharge':
|
case 'recharge':
|
||||||
PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext);
|
PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext);
|
||||||
$app->wechat->success();
|
$app->wechat->success();
|
||||||
break;
|
break;
|
||||||
|
case 'wechat_common':
|
||||||
|
default:
|
||||||
|
PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext);
|
||||||
|
$app->wechat->success();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ class OrderController extends BaseApiController
|
|||||||
StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order);
|
StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$result = PaymentLogic::pay($pay_type, 'StoreOrder', $order, $this->userInfo['terminal'], $redirectUrl);
|
$result = PaymentLogic::pay($pay_type, 'wechat_common', $order, $this->userInfo['terminal'], $redirectUrl);
|
||||||
if (PaymentLogic::hasError()) {
|
if (PaymentLogic::hasError()) {
|
||||||
return $this->fail(PaymentLogic::getError());
|
return $this->fail(PaymentLogic::getError());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user