123333
This commit is contained in:
@@ -44,6 +44,9 @@ public class PayController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PayManager payManager;
|
private PayManager payManager;
|
||||||
|
|
||||||
|
private static final String NOTIFY_WX_URL = "/api/pay/wx/notify";
|
||||||
|
private static final String NOTIFY_ALI_URL = "/api/pay/ali/notify";
|
||||||
|
|
||||||
@PostMapping(value = "/wx")
|
@PostMapping(value = "/wx")
|
||||||
@Operation(summary = "微信支付")
|
@Operation(summary = "微信支付")
|
||||||
@Log(title = "微信支付", businessType = BusinessType.OTHER, isSaveDb = true)
|
@Log(title = "微信支付", businessType = BusinessType.OTHER, isSaveDb = true)
|
||||||
@@ -67,7 +70,7 @@ public class PayController {
|
|||||||
.out_trade_no(WxPayKit.generateStr())
|
.out_trade_no(WxPayKit.generateStr())
|
||||||
.total_fee(payOrderInfo.getPriceFenStr())
|
.total_fee(payOrderInfo.getPriceFenStr())
|
||||||
.spbill_create_ip(ip)
|
.spbill_create_ip(ip)
|
||||||
.notify_url(payConfig.getNotifyUrl())
|
.notify_url(payConfig.getNotifyUrl()+NOTIFY_WX_URL)
|
||||||
.trade_type(TradeType.APP.getTradeType())
|
.trade_type(TradeType.APP.getTradeType())
|
||||||
.build()
|
.build()
|
||||||
.createSign(payConfig.getWxKey(), SignType.HMACSHA256);
|
.createSign(payConfig.getWxKey(), SignType.HMACSHA256);
|
||||||
@@ -117,7 +120,7 @@ public class PayController {
|
|||||||
model.setTimeoutExpress("30m");
|
model.setTimeoutExpress("30m");
|
||||||
model.setTotalAmount(payOrderInfo.getPrice().toString());
|
model.setTotalAmount(payOrderInfo.getPrice().toString());
|
||||||
String notifyUrl = AliPayApiConfigKit.getAliPayApiConfig().getServiceUrl();
|
String notifyUrl = AliPayApiConfigKit.getAliPayApiConfig().getServiceUrl();
|
||||||
String orderInfo = AliPayApi.appPayToResponse(model, notifyUrl).getBody();
|
String orderInfo = AliPayApi.appPayToResponse(model, notifyUrl+NOTIFY_ALI_URL).getBody();
|
||||||
PayReturnResp resp = new PayReturnResp();
|
PayReturnResp resp = new PayReturnResp();
|
||||||
resp.setData(orderInfo);
|
resp.setData(orderInfo);
|
||||||
return R.ok(resp);
|
return R.ok(resp);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class PayConfig implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String publicKey;
|
private String publicKey;
|
||||||
/**
|
/**
|
||||||
*
|
* 回调域名
|
||||||
*/
|
*/
|
||||||
private String notifyUrl;
|
private String notifyUrl;
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user