SpringBoot支付宝沙箱 支付 退款

https://blog.csdn.net/weixin_44520739/article/details/89214609支付宝公钥要用商户公钥换取配置信息Configimport org.springframework.stereotype.Component;import java.io.FileWriter;import java.io.IOException;@Componentpublic class AlipayConfig {//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本
摘要由CSDN通过智能技术生成

https://blog.csdn.net/weixin_44520739/article/details/89214609

支付宝公钥要用商户公钥换取

配置信息
在这里插入图片描述
Config

import org.springframework.stereotype.Component;

import java.io.FileWriter;
import java.io.IOException;
@Component
public class AlipayConfig {
   
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    // 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号
    public static String app_id = ;
    // 商户私钥,您的PKCS8格式RSA2私钥
    public static String merchant_private_key = ;
    // 支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = ;
    // 服务器异步通知页面路径  需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
    public static String notify_url = "http://localhost:8376/alipay/failure";
    // 页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://localhost:8376/alipay/success";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关,这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
    // 支付宝网关
    public static String log_path = "D:\\logs\\";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志,方便测试(看网站需求,也可以改成把记录存入数据库)
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
   
        FileWriter writer = null;
        try {
   
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
   
            e.printStackTrace();
        } finally {
   
            if (writer != null) {
   
                try {
   
                    writer.close();
                } catch (IOException e) {
   
                    e.printStackTrace<
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值