// 调起支付
public function pay(Request $request)
{
$openid = $request->param('openid', 0);
$orderNo = $request->param('orderNo', 0);
$findOrder = Db::table('gc_order')->where(['orderNo' => $orderNo, 'openid' => $openid])->find();
if (!$findOrder) {
return self::err('订单不存在');
}
$findUser = Db::table('data_user')->where('openid', $openid)->find();
if (!$findUser) {
return self::err('用户不存在');
}
$tt_pay_app_id = sysconf('wechat.dy_apppid');
$tt_merchant_id = sysconf('wechat.dy_mch_id');
$tt_pay_secret_key = $app_secret = sysconf('wechat.dy_appsecret');
$ip = $this->getRealIp();
$risk_info = [
'ip' => $ip,
];
$orderInfo = [
"app_id" => $tt_pay_app_id,
"sign_type" => "MD5",
"out_order_no" => $orderNo,
"merchant_id" => $tt_merchant_id,
"timestamp" => (string) time(),
"product_code" => "pay",
"payment_type" => "direct",
"total_amount" => $findOrder['price'] * 100,
"trade_type" =&g
(字节跳动(头条、抖音)小程序支付(PHP + UniApp,亲测可用)
最新推荐文章于 2025-02-12 23:54:34 发布