update
This commit is contained in:
@@ -80,19 +80,31 @@ class Wechat
|
||||
*/
|
||||
public function payment()
|
||||
{
|
||||
$userId = $GLOBALS['data']['userid'];
|
||||
if (empty($userId)) {
|
||||
return show("未登录!", NEED_LOGIN);
|
||||
$clientToken = Request::get('token');
|
||||
$orderId = Request::get('order_id');
|
||||
if ($clientToken) {
|
||||
$tk = json_decode(authcode($clientToken), true);
|
||||
$userId = $tk['userid'];
|
||||
}
|
||||
$user = AppUser::findOrEmpty($userId);
|
||||
if (! $user) {
|
||||
exit('NO USER');
|
||||
}
|
||||
|
||||
$user = AppUser::find($userId);
|
||||
$order = \app\model\Order::find($orderId);
|
||||
|
||||
|
||||
$notifyUrl = Route::buildUrl('wechat/paid')
|
||||
->suffix(false)
|
||||
->domain(true);
|
||||
$config = Config::get('wechat.payment');
|
||||
$payment = Factory::payment($config);
|
||||
$unify = $payment->order->unify([
|
||||
|
||||
dump($notifyUrl);
|
||||
|
||||
dd($order);
|
||||
|
||||
$config = Config::get('wechat.payment');
|
||||
$payment = Factory::payment($config);
|
||||
$unify = $payment->order->unify([
|
||||
'body' => '商品订单',
|
||||
'out_trade_no' => time(),
|
||||
'total_fee' => 100,
|
||||
|
||||
Reference in New Issue
Block a user