1
0
Fork 0
mirror of https://github.com/yunluo/gdk.git synced 2024-05-12 03:06:54 +02:00

修复问题

This commit is contained in:
云落 2020-03-08 22:50:20 +08:00
parent 26c19071be
commit e3e72cefdb
3 changed files with 8 additions and 8 deletions

View file

@ -193,10 +193,10 @@ jQuery(function ($) { /**声明加载jQuery */
closeOnClickOutside: false,
button: "" + f[2] + "支付已完成",
}).then(() => {
if (f[4]) {
check_pay_points(c, f[1]); /**用户id,订单号,积分充值检测 */
} else {
if (f[4] == '1') {
check_pay_view(c, f[1]); /**文章id,订单号,付费可见检测 */
} else {
check_pay_points(c, f[1]); /**用户id,订单号,积分充值检测 */
}
});
new QRious({

View file

@ -121,7 +121,7 @@ function pay_view() {
if( !isset( $_POST['action'] ) || $_POST['action'] !== 'pay_view' ) exit('400');
if (!isset($_POST['money']) || !isset($_POST['way'])) exit('400');//无脑输出400错误
if (isset($_POST['id'])) {
payjs_action('在线付费查看',$_POST['id']);//标题,文章id
payjs_action('在线付费查看','PP'.$_POST['id']);//标题,文章id
}
}
add_action( 'wp_ajax_pay_view', 'pay_view' );
@ -187,7 +187,7 @@ function check_pay_view() {
if (!isset($_POST['id']) || !isset($_POST['orderid'])) exit('400');//无脑输出400错误
if ( $_POST['action'] == 'check_pay_view') {
$sid = get_transient('PP'.$_POST['id']);
if(in_string($sid,'E20') && $orderid == $sid) {
if(in_string($sid,'E20') && $_POST['orderid'] == $sid) {
exit('200');//OK
} else {
exit('400');//no

View file

@ -915,7 +915,7 @@ function gdk_get_link_items() {
* 订单备注
* $_POST['money'] = 提交的金额,$_POST['way'] = 支付方式,支付宝为alipay,不设置默认微信,
*/
function payjs_action($body,$attach){
function payjs_action($body,$attach,$money){
$config = [
'mchid' => gdk_option('gdk_payjs_id'), // 配置商户号
'key' => gdk_option('gdk_payjs_key'), // 配置通信密钥
@ -926,11 +926,11 @@ function payjs_action($body,$attach){
'body' => $body, // 订单标题
'attach' => $attach, // 订单备注
'out_trade_no' => gdk_order_id(),// 订单号
'total_fee' => intval($_POST['money'])*100,// 金额,单位:分
'total_fee' => intval($money)*100,// 金额,单位:分
'notify_url' => GDK_BASE_URL.'/public/notify.php',//异步通知文件
'hide' => '1'
];
$result['money'] = intval($_POST['money']);//RMB金额
$result['money'] = intval($money);//RMB金额
$result['trade_no'] = $data['out_trade_no'];
if( $_POST['way'] == 'alipay' ) {
$data['type'] = 'alipay';