新增adapay的配置,以及微信公众号支付模型。

This commit is contained in:
clunt 2022-04-11 10:35:53 +08:00
parent 7fbee4f068
commit eb8d4a8256
3 changed files with 40 additions and 0 deletions

View File

@ -1,14 +1,46 @@
package com.ghy.web.controller.pay;
import com.alibaba.fastjson.JSONObject;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.utils.WxUtils;
import org.springframework.stereotype.Controller;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
@Controller
@RequestMapping("/pay/wx")
public class WxPayController extends BaseController {
/**
* 微信公众号支付.
* https://open.weixin.qq.com/connect/oauth2/authorize?
* appid=wx404f2439a8c24e15
* &redirect_uri=http%3A%2F%2Fwww.opsoul.com%2Fwx%2Fopenid
* &response_type=code
* &scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect
* */
@GetMapping("/pub")
public AjaxResult pubPay(HttpServletRequest request){
String code = request.getParameter("code");
String orderId = request.getParameter("orderId");
// 查询回订单信息如果订单不存在则退出.
try {
JSONObject wxUser = WxUtils.getOpenid(code);
String openId = wxUser.getString("openid");
//调用adapay微信公众号支付.
//拼接消息给前端.前端通过JSAPI调用微信支付
}catch (Exception e){
}
return AjaxResult.success();
}
}

View File

@ -146,3 +146,10 @@ qiniu:
secretKey: 'V8SM9nkbO-dft4JmG7UaCH6RYxXdqzrvQ0zWO2W3'
bucketName: 'gqz'
mediaUrl: 'http://gqz.opsoul.com/'
adapay:
appId:
notifyUrl:
apiKey:
mockApiKey:
rsaPrivateKey:

View File

@ -10,4 +10,5 @@ import com.ghy.common.adapay.callback.model.DrawCashReply;
public interface DrawCashCallback {
void onReply(DrawCashReply reply);
}