接入支付宝 联调修改

This commit is contained in:
2024-02-15 14:03:44 +08:00
parent 318d0a1441
commit 87580cfece
3 changed files with 10 additions and 7 deletions

View File

@@ -35,12 +35,14 @@ public class AliPayController {
@ApiOperation("统一收单下单并支付页面接口的调用")
@PostMapping("/trade/page/pay/{productId}")
public Response<String> tradePagePay(@PathVariable Long productId){
public Response<String> tradePagePay(@PathVariable Long productId,@RequestParam String returnUrl){
System.out.println(productId + " " + returnUrl);
log.info("统一收单下单并支付页面接口的调用");
//支付宝开放平台接受 request 请求对象后
// 会为开发者生成一个html 形式的 form表单包含自动提交的脚本
String formStr = aliPayService.tradeCreate(productId);
String formStr = aliPayService.tradeCreate(productId, returnUrl);
//我们将form表单字符串返回给前端程序之后前端将会调用自动提交脚本进行表单的提交
//此时表单会自动提交到action属性所指向的支付宝开放平台中从而为用户展示一个支付页面
return Response.success(formStr);