提交 0eb0a4df 编写于 作者: D devil_gong

头条支付

上级 c23dd058
......@@ -57,22 +57,21 @@ class ToutiaoService
'merchant_id' => $merchant_id,
'app_id' => $app_id,
'sign_type' => 'MD5',
'timestamp' => (string) time(),
'timestamp' => time(),
'version' => '2.0',
'trade_type' => 'H5',
'product_code' => 'pay',
'payment_type' => 'direct',
'outorderno' => $order['order_no'],
'uid' => md5($params['user']['id']),
'total_amount' => (string) $order['total_price']*100,
'total_amount' => $order['total_price']*100,
'currency' => 'CNY',
'subject' => '订单支付',
'body' => $order['order_no'],
'trade_time' => (string) $order['add_time'],
'valid_time' => (string) MyC('common_order_close_limit_time', 30, true)*60,
'trade_time' => $order['add_time'],
'valid_time' => intval(MyC('common_order_close_limit_time', 30, true))*60,
'notify_url' => __MY_URL__,
];
$order_info['sign'] = (new \base\Toutiao())->PaySignCreated($order_info, $secret);
// 支付方式
$service = 1;
......@@ -92,6 +91,9 @@ class ToutiaoService
break;
}
// 签名
$order_info['sign'] = (new \base\Toutiao())->PaySignCreated($order_info, $secret);
// 返回数据
$result = [
'order_info' => $order_info,
......
......@@ -68,7 +68,7 @@ class Toutiao
$sign = '';
foreach($data AS $key=>$val)
{
if($key != 'sign' && $key != 'risk_info' && $val != '' && $val != null)
if($key != 'sign' && $key != 'risk_info' && $val != '')
{
$sign .= "$key=$val&";
}
......
......@@ -237,7 +237,8 @@ Page({
console.log(res.data.data.order_info)
tt.pay({
orderInfo: res.data.data.order_info,
service: res.data.data.service,
//service: res.data.data.service,
service: 1,
_debug: 1,
getOrderStatus(res) {
let { out_order_no } = res;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册