GithubHelp home page GithubHelp logo

wechat-pay's Introduction

wechat-pay

简化服务端代码中关于微信支付的逻辑,简化服务端对支付接口的访问

配置文件

作为服务商配置文件 src/test/resources/service.properties

# 服务商配置  
appId=  
apiKey=  
aesKey=  
mchId=

# 特约商户  
subAppId=  
subMchId=

# 通知  
payNotify=  
refundNotify=  
profitNotify=
 
# 路径
certPath=

作为普通商户配置文件 src/test/resources/standard.properties

# 商户配置  
appId=  
apiKey=  
aesKey=  
mchId=

# 通知  
payNotify=  
refundNotify=  
 
# 路径
certPath=

代码示例

/**
 * 统一下单
 */
public void unifiedOrder() {
    String appId = config.getAppId();
    String mchId = config.getMchId();
    String subMchId = config.getSubMchId();
    String body = "测试支付";
    String outTradeNo = NonceStrUtil.generate();
    int totalFee = 100;
    String spbillCreateIp = "127.0.0.1";
    String notifyUrl = config.getPayNotify();
    UnifiedOrderRequest request = new UnifiedOrderRequest(appId, mchId, subMchId, body, outTradeNo, totalFee, spbillCreateIp, notifyUrl, TradeType.JSAPI);
    request.setSubAppId(config.getSubAppId());
    request.setSubOpenId("oGimf4l6H20K00gDjXzr-cJFozP4");
    request.setProfitSharing("Y");

    UnifiedOrderResponse response = client.execute(request);
    JsonFormat.print(response);
  }

实现接口列表

  • 支付

    • 统一下单
    • 订单查询
    • 关闭订单
    • 退款
    • 退款查询
  • 分账

    • 查询订单最大分账比例
    • 添加分账接收方
    • 删除分账接收方
    • 请求单次分账
    • 查询分账结果
  • 进件

    • 小微申请入驻
    • 查询申请状态
    • 提交升级申请
    • 查询升级状态
    • 修改结算银行卡
    • 修改联系人
    • 关注配置
    • 支付目录配置
    • 绑定appId配置
    • 配置查询
  • 转帐

    • 企业付款
    • 查询付款

联系

[email protected]

wechat-pay's People

Stargazers

 avatar

Watchers

 avatar

Forkers

song12138

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.