feat : pay callback

This commit is contained in:
2025-02-17 18:00:15 +08:00
parent ba2bb6874e
commit b11f033185
7 changed files with 199 additions and 26 deletions

View File

@@ -17,6 +17,7 @@ use App\Constants\Common\PayCode;
use App\Exception\ErrException;
use App\Model\Order;
use App\Model\PayOrder;
use App\Model\UserThird;
use App\Service\Api\BaseService;
use App\Service\Common\Pay\Wx\WxJsRechargeOrderService;
use Hyperf\Di\Annotation\Inject;
@@ -134,6 +135,12 @@ class PlacePayService extends BaseService
return null;
}
/**
* @var UserThird $userThirdModel
*/
#[Inject]
protected UserThird $userThirdModel;
/**
* @return WxJsRechargeOrderService
*/
@@ -145,7 +152,8 @@ class PlacePayService extends BaseService
throw new ErrException('充值异常');
}
$rechargeService->openId = '123';
$rechargeService->openId = $this->userThirdModel->getWxThirdInfoByUserId($this->userId);
if (empty($rechargeService->openId)) throw new ErrException('该账户不可使用微信支付');
return $rechargeService;
}