支付逻辑测试

This commit is contained in:
2022-09-09 14:46:20 +08:00
parent f9f3ea21c3
commit a15297de92

View File

@@ -80,6 +80,13 @@ class Wechat
*/
public function payment()
{
$userId = $GLOBALS['data']['userid'];
if (empty($userId)) {
return show("未登录!", NEED_LOGIN);
}
$user = AppUser::find($userId);
$notifyUrl = Route::buildUrl('wechat/paid')
->suffix(false)
->domain(true);
@@ -91,7 +98,7 @@ class Wechat
'total_fee' => 100,
'notify_url' => $notifyUrl,
'trade_type' => 'JSAPI',
'openid' => '$openid',
'openid' => $user->openid,
]);
dump($unify);
// $prepayId = $unify->prepay_id;