This commit is contained in:
2022-09-09 13:53:34 +08:00
parent f088dcf5e9
commit a0f67acdce

View File

@@ -68,13 +68,18 @@ class Wechat
*/ */
public function payment(): string public function payment(): string
{ {
$notifyUrl = Route::buildUrl('wechat/paid')
->suffix(false)
->domain(true);
$config = Config::get('wechat.payment'); $config = Config::get('wechat.payment');
$payment = Factory::payment($config); $payment = Factory::payment($config);
$unify = $payment->order->unify([ $unify = $payment->order->unify([
'body' => '商品订单', 'body' => '商品订单',
'out_trade_no' => time(), 'out_trade_no' => time(),
'total_fee' => 100, 'total_fee' => 100,
'notify_url' => '', 'notify_url' => $notifyUrl,
'trade_type' => 'JSAPI', 'trade_type' => 'JSAPI',
'openid' => '$openid', 'openid' => '$openid',
]); ]);