新增adapay的配置,以及微信公众号支付模型。
This commit is contained in:
parent
7fbee4f068
commit
eb8d4a8256
|
|
@ -1,14 +1,46 @@
|
||||||
package com.ghy.web.controller.pay;
|
package com.ghy.web.controller.pay;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ghy.common.core.controller.BaseController;
|
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.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 org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/pay/wx")
|
@RequestMapping("/pay/wx")
|
||||||
public class WxPayController extends BaseController {
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,3 +146,10 @@ qiniu:
|
||||||
secretKey: 'V8SM9nkbO-dft4JmG7UaCH6RYxXdqzrvQ0zWO2W3'
|
secretKey: 'V8SM9nkbO-dft4JmG7UaCH6RYxXdqzrvQ0zWO2W3'
|
||||||
bucketName: 'gqz'
|
bucketName: 'gqz'
|
||||||
mediaUrl: 'http://gqz.opsoul.com/'
|
mediaUrl: 'http://gqz.opsoul.com/'
|
||||||
|
|
||||||
|
adapay:
|
||||||
|
appId:
|
||||||
|
notifyUrl:
|
||||||
|
apiKey:
|
||||||
|
mockApiKey:
|
||||||
|
rsaPrivateKey:
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ import com.ghy.common.adapay.callback.model.DrawCashReply;
|
||||||
public interface DrawCashCallback {
|
public interface DrawCashCallback {
|
||||||
|
|
||||||
void onReply(DrawCashReply reply);
|
void onReply(DrawCashReply reply);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue