Skip to content

Commit

Permalink
feat: 支付(4)
Browse files Browse the repository at this point in the history
  • Loading branch information
phy19870227 committed May 22, 2021
1 parent 4bda30e commit 06b16b6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 自定义
logs/*
application-demo.yml
*.p12

# Eclipse
.project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.springframework.beans.BeansException;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
Expand Down Expand Up @@ -313,6 +314,12 @@ private ChannelClientParam handleResponse(WxPayService wxpayService, WxPayUnifie
BeanUtil.copyProperties(result, clientParam);
return clientParam;
}
case WxPayConstants.TradeType.APP: {
WxpayAppClientParam clientParam = new WxpayAppClientParam();
WxPayAppOrderResult result = wxpayService.createOrder(request);
BeanUtil.copyProperties(result, clientParam);
return clientParam;
}
default:
throw new BusinessException("未知的支付方式");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
Expand All @@ -25,6 +26,10 @@ public class CreateTradeReq {
@ApiModelProperty("扩展信息map")
private Map<String, Object> metadataMap;

public CreateTradeReq() {
this.metadataMap = new HashMap<>();
}

public String getBizType() {
return bizType;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
stiger:
pay:
alipay-merchants:
mmkAlipay:
testAlipay:
app-id: 111111
merchant-private-key: 111111
alipay-public-key: 1111111
notify-url: http://demo.org${server.servlet.context-path}/alipayNotify
wxpay-merchants:
testWxpay:
app-id: 111111
secret: 111111
mch-id: 111111
mch-key: 111111
key-path: 'classpath*:apiclient_cert.p12'
spbill-create-ip: 127.0.0.1
notify-url: http://demo.org${server.servlet.context-path}/wxpayNotify/testWxpay
refund-notify-url: http://demo.org${server.servlet.context-path}/wxpayNotify/refund/testWxpay
biz-merchants:
Demo1Alipay: mmkAlipay
Demo1Alipay: testAlipay
Demo1Wxpay: testWxpay
biz-infos:
Demo1: 测试支付业务1

0 comments on commit 06b16b6

Please sign in to comment.