您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop银联电子支付(ChinaPay)接口配置代码

紫寒2025-01-06 11:09:52ecshop商城教程已有人查阅

导读/includes/modules/payment/chinapay目录中存放银联密钥,PgPubk.key 是 公钥;MerPrK_123456789012345_20120227000000.key是私钥,/includes/modules

/includes/modules/payment/chinapay目录中存放银联密钥,PgPubk.key 是 公钥;MerPrK_123456789012345_20120227000000.key是私钥,/includes/modules /payment/chinapaynetpayclient_config.php如下:
<?php
/**
* ECSHOP 银联电子支付(ChinaPay)接口配置
*/
/*请按照您的实际情况配置以下各参数*/
//私钥文件,在chinapay申请商户号时获取,请相应修改此处,可填相对路径,下同
define("PRI_KEY", ROOT_PATH . "includes/modules/payment/chinapay/MerPrK_123456789012345_20120227000000.key");
//公钥文件,示例中已经包含
define("PUB_KEY", ROOT_PATH . "includes/modules/payment/chinapay/PgPubk.key");
/*如您已有生产密钥,请修改以下配置,默认为测试环境*/
//支付请求地址(测试)
//define("REQ_URL_PAY","");
//支付请求地址(生产)
define("REQ_URL_PAY","https://payment.chinapay.com/pay/TransGet");
//查询请求地址(测试)
//define("REQ_URL_QRY","");
//查询请求地址(生产)
define("REQ_URL_QRY","http://console.chinapay.com/QueryWeb/processQuery.jsp");
//退款请求地址(测试)
//define("REQ_URL_REF","");
//退款请求地址(生产)
define("REQ_URL_REF","");
function getcwdOL(){
$total = $_SERVER[PHP_SELF];
$file = explode("/", $total);
$file = $file[sizeof($file)-1];
return substr($total, 0, strlen($total)-strlen($file)-1);
}
function getSiteUrl(){
//$host = $_SERVER[SERVER_NAME];
//$port = ($_SERVER[SERVER_PORT]=="80")?"":":$_SERVER[SERVER_PORT]";
//return "http://" . $host . $port . getcwdOL();
}
function traceLog($file, $log){
$f = fopen($file, 'a');
if($f){
fwrite($f, date('Y-m-d H:i:s') . " => $log\n");
fclose($f);
}
}
//取得本示例安装位置
$site_url = getSiteUrl();
?>

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签