Browse Source

modify path online

master
用户名 3 years ago
parent
commit
eba1a0068f
  1. 89
      mobile/plugins/payment/wxpay.php
  2. 4
      mobile/source/helpers/dalianpay/config/config.php
  3. 16
      mobile/source/helpers/dalianpay/demo/dalianpay.php
  4. 6
      mobile/source/helpers/dalianpay/library/Base.php

89
mobile/plugins/payment/wxpay.php

@ -175,96 +175,9 @@ class wxpay
// echo $file . "<br>"; // echo $file . "<br>";
// } // }
// } // }
$directory = 'helpers/dalianpay/demo'; // 替换为您要包含文件的目录路径
// $this->includeDirectory($directory);
// 打开目录
if ($handle = opendir($directory)) {
// 遍历目录中的文件和目录
while (($file = readdir($handle)) !== false) {
// 排除当前目录(.)和上级目录(..)
if ($file != '.' && $file != '..') {
// 检查文件是否为 PHP 文件
if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
// 构建文件的完整路径
$filePath = $directory . '/' . $file;
// 包含 PHP 文件
include_once $filePath;
echo $filePath . '\n\r';
}
}
}
// 关闭目录句柄
closedir($handle);
}
$directory = 'helpers/dalianpay/cert'; // 替换为您要包含文件的目录路径
// $this->includeDirectory($directory);
// 打开目录
if ($handle = opendir($directory)) {
// 遍历目录中的文件和目录
while (($file = readdir($handle)) !== false) {
// 排除当前目录(.)和上级目录(..)
if ($file != '.' && $file != '..') {
// 构建文件的完整路径
$filePath = $directory . '/' . $file;
// 包含 PHP 文件
include_once $filePath;
echo $filePath . '\n\r';
}
}
// 关闭目录句柄
closedir($handle);
}
$directory = 'helpers/dalianpay/config'; // 替换为您要包含文件的目录路径
// $this->includeDirectory($directory);
// 打开目录
if ($handle = opendir($directory)) {
// 遍历目录中的文件和目录
while (($file = readdir($handle)) !== false) {
// 排除当前目录(.)和上级目录(..)
if ($file != '.' && $file != '..') {
// 检查文件是否为 PHP 文件
if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
// 构建文件的完整路径
$filePath = $directory . '/' . $file;
// 包含 PHP 文件
include_once $filePath;
echo $filePath . '\n\r';
}
}
}
// 关闭目录句柄
closedir($handle);
}
$directory = 'helpers/dalianpay/library'; // 替换为您要包含文件的目录路径
// $this->includeDirectory($directory);
// 打开目录
if ($handle = opendir($directory)) {
// 遍历目录中的文件和目录
while (($file = readdir($handle)) !== false) {
// 排除当前目录(.)和上级目录(..)
if ($file != '.' && $file != '..') {
// 检查文件是否为 PHP 文件
if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
// 构建文件的完整路径
$filePath = $directory . '/' . $file;
// 包含 PHP 文件
include_once $filePath;
echo $filePath . '\n\r';
}
}
}
// 关闭目录句柄
closedir($handle);
}
// require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php'); require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php');
// include_once(BASE_PATH . "../plugins/payment/dalianpay/demo/dalianpay.php");
$new_plugin = new dalianpay(); $new_plugin = new dalianpay();
$response_data = $new_plugin->pay($this->encrypt($_SESSION['openid']), $order['order_sn'], $order_amount); $response_data = $new_plugin->pay($this->encrypt($_SESSION['openid']), $order['order_sn'], $order_amount);

4
mobile/source/helpers/dalianpay/config/config.php

@ -18,9 +18,9 @@
// 加密方式 // 加密方式
'signtype' => 'RSA', 'signtype' => 'RSA',
// 渠道公钥 // 渠道公钥
'public_key' => dirname(__FILE__) . '/../cert/channel_public_key.pem', 'public_key' => BASE_PATH . 'helpers/dalianpay/cert/channel_public_key.pem',
// 商户私钥 // 商户私钥
'private_key' => dirname(__FILE__) . '/../cert/cus_private_key.pem', 'private_key' => BASE_PATH . 'helpers/dalianpay/cert/cus_private_key.pem',
// 统一支付接口 测试地址 // 统一支付接口 测试地址
'pay_url' => 'https://open.dalianpay.cn/payapi/unitorder/pay', 'pay_url' => 'https://open.dalianpay.cn/payapi/unitorder/pay',

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

@ -44,7 +44,7 @@ class dalianpay{
// var_dump($redirect_url); // var_dump($redirect_url);
// 加载基础类 // 加载基础类
require_once('../library/Base.php'); require_once(BASE_PATH . 'helpers/dalianpay/library/Base.php');
$Base = new Base(); $Base = new Base();
// 获取配置信息 // 获取配置信息
@ -165,13 +165,13 @@ class dalianpay{
} }
} }
echo 'hi there.....\n\r'; // echo 'hi there.....\n\r';
$new_plugin = new dalianpay(); // $new_plugin = new dalianpay();
$openid_crypt = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; // $openid_crypt = 'oCTanxBeiVFWIekJT_GiPZM2UiGY';
$order_sn = '2023080355429'; // $order_sn = '2023080355429';
$order_amount = '600'; // $order_amount = '600';
$response_data = $new_plugin->pay($openid_crypt,$order_sn,$order_amount); // $response_data = $new_plugin->pay($openid_crypt,$order_sn,$order_amount);
echo $response_data; // echo $response_data;
?> ?>

6
mobile/source/helpers/dalianpay/library/Base.php

@ -17,12 +17,12 @@ class Base
{ {
// 读取配置 // 读取配置
$this->config = require_once('../config/config.php'); $this->config = require_once(BASE_PATH . 'helpers/dalianpay/config/config.php');
// 实例化加解密类 // 实例化加解密类
require_once('Crypt.php'); require_once(BASE_PATH . 'helpers/dalianpay/library/Crypt.php');
$this->Crypt = new Crypt($this->config); $this->Crypt = new Crypt($this->config);
// 实例化请求类 // 实例化请求类
require_once('Request.php'); require_once(BASE_PATH . 'helpers/dalianpay/library/Request.php');
$this->Request = new Request($this->config); $this->Request = new Request($this->config);
} }

Loading…
Cancel
Save