|
|
|
@ -122,6 +122,7 @@ class wxpay |
|
|
|
// $_SESSION['openid'] = $openid; |
|
|
|
$_SESSION['openid'] = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; //sc_test l or I |
|
|
|
} |
|
|
|
$_SESSION['openid'] = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; |
|
|
|
$order_amount = $order['order_amount'] * 100; |
|
|
|
|
|
|
|
// 访问大连支付接口 |
|
|
|
@ -144,18 +145,41 @@ class wxpay |
|
|
|
echo $order['order_sn'] . "\n\r"; |
|
|
|
echo $order_amount . "\n\r"; |
|
|
|
|
|
|
|
$directory = BASE_PATH . '../plugins/payment'; // /data/www/wwwroot/dcs1.3/mobile/source/ |
|
|
|
$files = scandir($directory); |
|
|
|
|
|
|
|
// 遍历文件列表并打印文件名 |
|
|
|
foreach ($files as $file) { |
|
|
|
// 排除当前目录(.)和上级目录(..) |
|
|
|
if ($file != '.' && $file != '..') { |
|
|
|
echo $file . "<br>"; |
|
|
|
// $directory = BASE_PATH . '../plugins/payment'; // /data/www/wwwroot/dcs1.3/mobile/source/ |
|
|
|
// $files = scandir($directory); |
|
|
|
|
|
|
|
// // 遍历文件列表并打印文件名 |
|
|
|
// foreach ($files as $file) { |
|
|
|
// // 排除当前目录(.)和上级目录(..) |
|
|
|
// if ($file != '.' && $file != '..') { |
|
|
|
// echo $file . "<br>"; |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// 递归include文件 |
|
|
|
function includeDirectory($directory) { |
|
|
|
if ($handle = opendir($directory)) { |
|
|
|
while (($file = readdir($handle)) !== false) { |
|
|
|
if ($file != '.' && $file != '..') { |
|
|
|
$filePath = $directory . '/' . $file; |
|
|
|
if (is_dir($filePath)) { |
|
|
|
includeDirectory($filePath); // 递归调用,处理子目录 |
|
|
|
} elseif (pathinfo($file, PATHINFO_EXTENSION) === 'php') { |
|
|
|
include_once $filePath; |
|
|
|
echo $filePath . '\n\r'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
closedir($handle); |
|
|
|
} |
|
|
|
} |
|
|
|
require_once(BASE_PATH . '../plugins/payment/dalianpay/demo/dalianpay.php'); |
|
|
|
include BASE_PATH . "../plugins/payment/dalianpay/demo/dalianpay.php"; |
|
|
|
|
|
|
|
$directory = 'helpers/dalianpay'; // 替换为您要包含文件的目录路径 |
|
|
|
includeDirectory($directory); |
|
|
|
|
|
|
|
require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php'); |
|
|
|
include_once(BASE_PATH . "../plugins/payment/dalianpay/demo/dalianpay.php"); |
|
|
|
|
|
|
|
$new_plugin = new dalianpay(); |
|
|
|
|
|
|
|
$response_data = $new_plugin->pay($this->encrypt($_SESSION['openid']), $order['order_sn'], $order_amount); |
|
|
|
|