zoukankan      html  css  js  c++  java
  • Ecshop银联电子支付(ChinaPay)接口配置

    /includes/modules/payment/chinapay目录中存放银联密钥,PgPubk.key 是网关公钥;MerPrK_123456789012345_20120227000000.key是私钥,/includes/modules /payment/chinapaynetpayclient_config.php如下:

     1 <?php
     2 
     3 /**
     4  * ECSHOP 银联电子支付(ChinaPay)接口配置
     5  */
     6 
     7 /*请按照您的实际情况配置以下各参数*/
     8 
     9 //私钥文件,在chinapay申请商户号时获取,请相应修改此处,可填相对路径,下同
    10 define("PRI_KEY", ROOT_PATH . "includes/modules/payment/chinapay/MerPrK_123456789012345_20120227000000.key");
    11 //公钥文件,示例中已经包含
    12 define("PUB_KEY", ROOT_PATH . "includes/modules/payment/chinapay/PgPubk.key");
    13 
    14 /*如您已有生产密钥,请修改以下配置,默认为测试环境*/
    15 
    16 //支付请求地址(测试)
    17 //define("REQ_URL_PAY","http://payment-test.chinapay.com/pay/TransGet");
    18 //支付请求地址(生产)
    19 define("REQ_URL_PAY","https://payment.chinapay.com/pay/TransGet");
    20 
    21 //查询请求地址(测试)
    22 //define("REQ_URL_QRY","http://payment-test.chinapay.com/QueryWeb/processQuery.jsp");
    23 //查询请求地址(生产)
    24 define("REQ_URL_QRY","http://console.chinapay.com/QueryWeb/processQuery.jsp");
    25 
    26 //退款请求地址(测试)
    27 //define("REQ_URL_REF","http://payment-test.chinapay.com/refund/SingleRefund.jsp");
    28 //退款请求地址(生产)
    29 define("REQ_URL_REF","https://bak.chinapay.com/refund/SingleRefund.jsp");
    30 
    31 function getcwdOL(){
    32 $total = $_SERVER[PHP_SELF];
    33 $file = explode("/", $total);
    34 $file = $file[sizeof($file)-1];
    35 return substr($total, 0, strlen($total)-strlen($file)-1);
    36 }
    37 
    38 function getSiteUrl(){
    39     //$host = $_SERVER[SERVER_NAME];
    40     //$port = ($_SERVER[SERVER_PORT]=="80")?"":":$_SERVER[SERVER_PORT]";
    41     //return "http://" . $host . $port . getcwdOL();
    42 }
    43 
    44 function traceLog($file, $log){
    45     $f = fopen($file, 'a'); 
    46     if($f){
    47         fwrite($f, date('Y-m-d H:i:s') . " => $log\n");
    48   fclose($f);
    49     } 
    50 }
    51 
    52 //取得本示例安装位置
    53 $site_url = getSiteUrl();
    54 ?>
  • 相关阅读:
    关于read函数的一些分析
    条件变量
    epoll的边缘触发与水平触发
    内核态的接收缓冲区和发送缓冲区
    SourceTreet提交时显示remote: Incorrect username or password ( access token )(4种解决办法)
    前端技术汇总+Vue最新快速上手
    MyBatisPlus性能分析插件,条件构造器,代码自动生成器详解
    博客园怎样在Markdown编辑模式下调整图片大小(已解决)
    MyBatisPlus分页查询,删除操作
    idea括号选中时出现一条下滑线(突出显示)打开或关闭方法
  • 原文地址:https://www.cnblogs.com/whendream/p/2814186.html
Copyright © 2011-2022 走看看