diff --git a/mobile/plugins/payment/wxpay.php b/mobile/plugins/payment/wxpay.php index e56685c..5a5b180 100755 --- a/mobile/plugins/payment/wxpay.php +++ b/mobile/plugins/payment/wxpay.php @@ -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 . "
"; + // $directory = BASE_PATH . '../plugins/payment'; // /data/www/wwwroot/dcs1.3/mobile/source/ + // $files = scandir($directory); + + // // 遍历文件列表并打印文件名 + // foreach ($files as $file) { + // // 排除当前目录(.)和上级目录(..) + // if ($file != '.' && $file != '..') { + // echo $file . "
"; + // } + // } + + // 递归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); diff --git a/mobile/plugins/payment/dalianpay/cert/channel_public_key.pem b/mobile/source/helpers/dalianpay/cert/channel_public_key.pem similarity index 100% rename from mobile/plugins/payment/dalianpay/cert/channel_public_key.pem rename to mobile/source/helpers/dalianpay/cert/channel_public_key.pem diff --git a/mobile/plugins/payment/dalianpay/cert/cus_private_key.pem b/mobile/source/helpers/dalianpay/cert/cus_private_key.pem similarity index 100% rename from mobile/plugins/payment/dalianpay/cert/cus_private_key.pem rename to mobile/source/helpers/dalianpay/cert/cus_private_key.pem diff --git a/mobile/plugins/payment/dalianpay/cert/cus_private_key.pem.test b/mobile/source/helpers/dalianpay/cert/cus_private_key.pem.test similarity index 100% rename from mobile/plugins/payment/dalianpay/cert/cus_private_key.pem.test rename to mobile/source/helpers/dalianpay/cert/cus_private_key.pem.test diff --git a/mobile/plugins/payment/dalianpay/config/config.php b/mobile/source/helpers/dalianpay/config/config.php similarity index 100% rename from mobile/plugins/payment/dalianpay/config/config.php rename to mobile/source/helpers/dalianpay/config/config.php diff --git a/mobile/plugins/payment/dalianpay/demo/cancel.php b/mobile/source/helpers/dalianpay/demo/cancel.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/cancel.php rename to mobile/source/helpers/dalianpay/demo/cancel.php diff --git a/mobile/plugins/payment/dalianpay/demo/close.php b/mobile/source/helpers/dalianpay/demo/close.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/close.php rename to mobile/source/helpers/dalianpay/demo/close.php diff --git a/mobile/plugins/payment/dalianpay/demo/dalianpay.php b/mobile/source/helpers/dalianpay/demo/dalianpay.php similarity index 94% rename from mobile/plugins/payment/dalianpay/demo/dalianpay.php rename to mobile/source/helpers/dalianpay/demo/dalianpay.php index 3434aff..c2ccd8a 100644 --- a/mobile/plugins/payment/dalianpay/demo/dalianpay.php +++ b/mobile/source/helpers/dalianpay/demo/dalianpay.php @@ -165,13 +165,13 @@ class dalianpay{ } } -// echo 'hi there.....\n\r'; -// $new_plugin = new dalianpay(); -// $openid_crypt = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; -// $order_sn = '2023080355429'; -// $order_amount = '600'; -// $response_data = $new_plugin->pay($openid_crypt,$order_sn,$order_amount); -// echo $response_data; +echo 'hi there.....\n\r'; +$new_plugin = new dalianpay(); +$openid_crypt = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; +$order_sn = '2023080355429'; +$order_amount = '600'; +$response_data = $new_plugin->pay($openid_crypt,$order_sn,$order_amount); +echo $response_data; ?> diff --git a/mobile/plugins/payment/dalianpay/demo/pay.php b/mobile/source/helpers/dalianpay/demo/pay.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/pay.php rename to mobile/source/helpers/dalianpay/demo/pay.php diff --git a/mobile/plugins/payment/dalianpay/demo/query.php b/mobile/source/helpers/dalianpay/demo/query.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/query.php rename to mobile/source/helpers/dalianpay/demo/query.php diff --git a/mobile/plugins/payment/dalianpay/demo/refund.php b/mobile/source/helpers/dalianpay/demo/refund.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/refund.php rename to mobile/source/helpers/dalianpay/demo/refund.php diff --git a/mobile/plugins/payment/dalianpay/demo/scan.php b/mobile/source/helpers/dalianpay/demo/scan.php similarity index 100% rename from mobile/plugins/payment/dalianpay/demo/scan.php rename to mobile/source/helpers/dalianpay/demo/scan.php diff --git a/mobile/plugins/payment/dalianpay/library/Base.php b/mobile/source/helpers/dalianpay/library/Base.php similarity index 100% rename from mobile/plugins/payment/dalianpay/library/Base.php rename to mobile/source/helpers/dalianpay/library/Base.php diff --git a/mobile/plugins/payment/dalianpay/library/Crypt.php b/mobile/source/helpers/dalianpay/library/Crypt.php similarity index 100% rename from mobile/plugins/payment/dalianpay/library/Crypt.php rename to mobile/source/helpers/dalianpay/library/Crypt.php diff --git a/mobile/plugins/payment/dalianpay/library/Request.php b/mobile/source/helpers/dalianpay/library/Request.php similarity index 100% rename from mobile/plugins/payment/dalianpay/library/Request.php rename to mobile/source/helpers/dalianpay/library/Request.php