Browse Source

add norify url

master
dutsc 3 years ago
parent
commit
ef1ecc3fc1
  1. 1
      mobile/source/apps/flow/controllers/IndexController.php
  2. 2
      mobile/source/helpers/dalianpay/demo/dalianpay.php
  3. 26
      mobile/wxnotify.php

1
mobile/source/apps/flow/controllers/IndexController.php

@ -1015,7 +1015,6 @@ class IndexController extends FrontendController {
}
}
}
}
$order['order_amount'] = 0.01; // sc_test

2
mobile/source/helpers/dalianpay/demo/dalianpay.php

@ -92,7 +92,7 @@ class dalianpay{
'randomstr' => md5( uniqid() ),
// 'body' => 'pages',
'acct' => $openid,
// 'notify_url' => $config['notify_url'], // 交易结果通知地址
'notify_url' => $config['notify_url'], // 交易结果通知地址
// 'sub_appid' => $config['sub_appid'],
// 'front_url' => '', // 支付完成跳转
);

26
mobile/wxnotify.php

@ -1,5 +1,31 @@
<?php
// 检查请求方法是否为POST
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// 从POST请求中获取支付结果参数,假设参数名为result
$cusid = $_POST['cusid'];
$trxcode = $_POST['trxcode'];
$trxid = $_POST['trxid'];
$trxamt = $_POST['trxamt'];
// 根据支付结果进行相应的业务处理
// if ($paymentResult === 'success') {
// // 支付成功的操作
// // ...
// } else {
// // 支付失败的操作
// // ...
// }
var_dump($cusid);
var_dump($trxcode);
var_dump($trxid);
var_dump($trxamt);
// 返回响应给平台,确认接收到通知
http_response_code(200); // 返回200状态码,表示成功接收到通知
} else {
// 非POST请求的处理
// ...
}
?>
Loading…
Cancel
Save