Commit e3d2e597 authored by jiaorz's avatar jiaorz

支付宝支付

parent 5a3185f2
......@@ -62,9 +62,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
@Autowired
MQServiceBiZ mqServiceBiZ;
@Value("${universal.url}")
String weixinHost;
static String weixinHost;
private static final String notifyUrl = weixinHost + "/api/universal/pay/app/unauth/notify/alipay";
public JSONObject preparepay(OrderPayVo orderPayVo) {
if (null == orderPayVo) {
......@@ -282,8 +282,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
AlipayClient alipayClient = new DefaultAlipayClient(SystemConfig.ALIPAY_PAY_BASE_URL + "/gateway.do",
SystemConfig.ALIPAY_APPID, SystemConfig.ALIPAY_PRIVATE_KEY, AlipayConstants.FORMAT_JSON,
"utf-8", SystemConfig.ALIPAY_PUBLIC_KEY, AlipayConstants.SIGN_TYPE_RSA2);
String notifyUrl = weixinHost + "/api/universal/pay/app/unauth/notify/alipay";
orderPayVo.setNotifyUrl(notifyUrl);
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
try {
return appOrderPay(alipayClient, orderPayVo);
......@@ -304,7 +303,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
"\"subject\":\"" + orderPayVo.getSubject() + "\"," +
"\"out_trade_no\":\"" + orderPayVo.getTradeNo() + "\"" +
" }");
request.setNotifyUrl(orderPayVo.getNotifyUrl());
request.setNotifyUrl(notifyUrl);
try {
//这里和普通的接口调用不同,使用的是sdkExecute
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
......@@ -332,7 +331,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
"\"product_code\":\"PRE_AUTH_ONLINE\"," +
"\"pay_timeout\":\"1d\"," +
"\"amount\": \"" + realAmount.toString() + "\" }");
request.setNotifyUrl(orderPayVo.getNotifyUrl());//异步通知地址,必填,该接口只通过该参数进行异步通知
request.setNotifyUrl(notifyUrl);//异步通知地址,必填,该接口只通过该参数进行异步通知
AlipayFundAuthOrderAppFreezeResponse response = alipayClient.sdkExecute(request);//注意这里是sdkExecute,可以获取签名参数
if (response.isSuccess()) {
log.info("调用成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment