初始化
parent
24b00784c3
commit
0b58a657de
|
@ -38,15 +38,15 @@ public class AliPayController {
|
|||
private static final String SIGN_TYPE ="RSA2";
|
||||
|
||||
@GetMapping("/pay") // 前端路径参数格式?subject=xxx&traceNo=xxx&totalAmount=xxx
|
||||
public void pay(AliPay aliPay, HttpServletResponse httpResponse) throws Exception {
|
||||
public void pay(String traceNo, HttpServletResponse httpResponse) throws Exception {
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(GATEWAY_URL, aliPayConfig.getAppId(),
|
||||
aliPayConfig.getAppPrivateKey(), FORMAT, CHARSET, aliPayConfig.getAlipayPublicKey(), SIGN_TYPE);
|
||||
AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
|
||||
request.setNotifyUrl(aliPayConfig.getNotifyUrl());
|
||||
request.setReturnUrl(aliPayConfig.getReturnUrl());
|
||||
request.setBizContent("{\"out_trade_no\":\"" + aliPay.getTraceNo() + "\","
|
||||
+ "\"total_amount\":\"" + aliPay.getTotalAmount() + "\","
|
||||
+ "\"subject\":\"" + aliPay.getSubject() + "\","
|
||||
request.setBizContent("{\"out_trade_no\":\"" + traceNo + "\","
|
||||
+ "\"total_amount\":\"" + 10 + "\","
|
||||
+ "\"subject\":\"" + "鸡你太美" + "\","
|
||||
+ "\"product_code\":\"FAST_INSTANT_TRADE_PAY\"}");
|
||||
String form = "";
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue