ping++接入企业付款

注册 ping++账号

在这里插入图片描述在界面上可查看应用的APPID

点击应用标题可以进行webhook的配置

在这里插入图片描述webhooks是ping++支付接口调用成功后,ping++进行回调。

在企业面板中可以查看开发所需参数在这里插入图片描述

所需的参数有appKey,appId,Ping++公钥,商户RSA私钥,公钥和私钥可以分别保存在文件内,设置路径后进行内容读取。商户RSA私钥和商户RSA公钥成对出现,获取公钥和私钥地址http://demo.pingxx.com/tools/genrsa.php 该地址为1024加密
http://demo.pingxx.com/tools/genrsa.php?len=2048 该地址为2048加密
注意:

  1. 每次刷新页面会得到不同的 RSA 密钥
  2. 若您需要保存,可将一对 RSA 密钥以 pem 格式保存到本地。
  3. 保存方式:复制以上工具生成的密钥至文本编辑器后,保存时文件后缀名写为 .pem

以下是代码

首先先创建 企业转账

public class PingppUtil {
  	public static void main(String[] args) throws Exception {
//        runDemos();   // 运行这个即可
	}
    public static void runDemos(Map<String, String> paramMap, String orderNo, int amount) throws Exception {
    	Pingpp.apiKey = CarUtils.PINGPP_API_KEY;  // api_key对应ping++的Test Secret Key以及Live Secret Key
    	Pingpp.appId = CarUtils.PINGPP_APP_ID;  // ping++appid
    	Pingpp.privateKeyPath = CarUtils.PINGPP_PRIVATE_KEY_PATH; // ping++私钥路径
    	System.setProperty("https.protocols", "TLSv1.2"); 
        PingppUtil pu = new PingppUtil();
        pu.create(paramMap, orderNo, amount);
    }
 
    /**
     * 读取文件, 部署 web 程序的时候, 签名和验签内容需要从 request 中获得
     * @param filePath
     * @return
     * @throws Exception
     */
    public static String getStringFromFile(String filePath) throws Exception {
        FileInputStream in = new FileInputStream(filePath);
        InputStreamReader inReader = new InputStreamReader(in, "UTF-8");
        BufferedReader bf = new BufferedReader(inReader);
        StringBuilder sb = new StringBuilder();
        
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值