作者 anyv
1 个管道 的构建 通过 耗费 0 秒

支付

... ... @@ -49,7 +49,7 @@ class PayController extends HomeBaseController
'body' => '百荣科技',
'detail' => '以客户为中心 以奋斗者文本',
'out_trade_no' => $data['order_number'],
'total_fee' => $data['money']*100, // 单位:分
'total_fee' => 1,//$data['money']*100, // 单位:分
'notify_url' => url('portal/pay/notify','','',true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址
'openid' => $openid, // trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识,
];
... ... @@ -62,6 +62,9 @@ class PayController extends HomeBaseController
if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS'){
$prepayId = $result->prepay_id;
$jsApiParameters=$payment->configForJSSDKPayment($prepayId);
$this->assign('name','北京煊坤博文图书有限公司');
$this->assign('price',$data['money']);
$this->assign('order_number',$data['order_number']);
$this->assign('jsApiParameters',json_encode($jsApiParameters));
return $this->fetch();
}else{
... ...
... ... @@ -19,6 +19,7 @@
//支付取消逻辑
}else if (res.err_msg=='get_brand_wcpay_request:ok'){
//支付成功逻辑
window.location.href = "{:url('index/index')}";
}else{
//支付失败逻辑
}
... ... @@ -43,11 +44,15 @@
<body>
<div class="wenx_xx">
<div class="mz">DEF0000000001</div>
<div class="wxzf_price">¥0.01</div>
<div class="mz">{$order_number}</div>
<div class="wxzf_price">¥{$price}</div>
</div>
<div class="skf_xinf">
<div class="all_w"> <span class="bt">收款方</span> <span class="fr">{$site_info.site_name}</span> </div>
<div class="all_w"> <span class="bt">收款方</span>
<span class="fr">
{$name}
</span>
</div>
</div>
<a onclick="callpay()" class="ljzf_but all_w">立即支付</a>
<script type="text/javascript">
... ...