mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
5.0
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package com.gitee.sop.payment.impl;
|
||||
|
||||
import com.gitee.sop.payment.open.OpenPayment;
|
||||
import com.gitee.sop.payment.open.req.PayOrderSearchRequest;
|
||||
import com.gitee.sop.payment.open.req.PayTradeWapPayRequest;
|
||||
import com.gitee.sop.payment.open.resp.PayOrderSearchResponse;
|
||||
import com.gitee.sop.payment.open.resp.PayTradeWapPayResponse;
|
||||
import java.util.UUID;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
/**
|
||||
@@ -22,4 +24,14 @@ public class OpenPaymentImpl implements OpenPayment {
|
||||
payTradeWapPayResponse.setPageRedirectionData(UUID.randomUUID().toString());
|
||||
return payTradeWapPayResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayOrderSearchResponse orderSearch(PayOrderSearchRequest request) {
|
||||
PayOrderSearchResponse payOrderSearchResponse = new PayOrderSearchResponse();
|
||||
payOrderSearchResponse.setOrderNo(request.getOrderNo());
|
||||
payOrderSearchResponse.setPayNo("xxxx");
|
||||
payOrderSearchResponse.setPayUserId(111L);
|
||||
payOrderSearchResponse.setPayUserName("Jim");
|
||||
return payOrderSearchResponse;
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package com.gitee.sop.payment.open;
|
||||
|
||||
import com.gitee.sop.payment.open.req.PayOrderSearchRequest;
|
||||
import com.gitee.sop.payment.open.req.PayTradeWapPayRequest;
|
||||
import com.gitee.sop.payment.open.resp.PayOrderSearchResponse;
|
||||
import com.gitee.sop.payment.open.resp.PayTradeWapPayResponse;
|
||||
import com.gitee.sop.support.annotation.Open;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -15,13 +17,18 @@ import io.swagger.annotations.ApiOperation;
|
||||
public interface OpenPayment {
|
||||
|
||||
@ApiOperation(
|
||||
value = "手机网站支付接口2.0",
|
||||
value = "手机网站支付接口",
|
||||
notes = "该接口是页面跳转接口,用于生成用户访问跳转链接。" +
|
||||
"请在服务端执行SDK中pageExecute方法,读取响应中的body()结果。" +
|
||||
"该结果用于跳转到页面,返回到用户浏览器渲染或重定向跳转到页面。" +
|
||||
"具体使用方法请参考 <a href=\"https://torna.cn\" target=\"_blank\">接入指南</a>"
|
||||
)
|
||||
@Open(value = "pay.trade.wap.pay", version = "2.0")
|
||||
@Open("pay.trade.wap.pay")
|
||||
PayTradeWapPayResponse tradeWapPay(PayTradeWapPayRequest request);
|
||||
|
||||
|
||||
@ApiOperation(value = "订单查询接口")
|
||||
@Open("pay.order.search")
|
||||
PayOrderSearchResponse orderSearch(PayOrderSearchRequest request);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.gitee.sop.payment.open.req;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class PayOrderSearchRequest {
|
||||
|
||||
@ApiModelProperty(value = "订单编号", required = true, example = "xxxx")
|
||||
@Length(max = 64) // 最大长度
|
||||
private String orderNo;
|
||||
|
||||
}
|
@@ -10,7 +10,7 @@ import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* alipay.trade.wap.pay(手机网站支付接口2.0)
|
||||
* pay.trade.wap.pay(手机网站支付接口)
|
||||
*
|
||||
* @author 六如
|
||||
* https://opendocs.alipay.com/open/29ae8cb6_alipay.trade.wap.pay?pathHash=1ef587fd&ref=api&scene=21
|
||||
@@ -40,7 +40,7 @@ public class PayTradeWapPayRequest {
|
||||
private String subject;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "销售产品码,商家和支付宝签约的产品码。手机网站支付为:QUICK_WAP_WAY",
|
||||
value = "销售产品码,商家和支付平台签约的产品码。手机网站支付为:QUICK_WAP_WAY",
|
||||
required = true,
|
||||
example = "QUICK_WAP_WAY"
|
||||
)
|
||||
@@ -76,7 +76,7 @@ public class PayTradeWapPayRequest {
|
||||
private String time_expire;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "商户传入业务信息,具体值要和支付宝约定,应用于安全,营销等参数直传场景,格式为json格式",
|
||||
value = "商户传入业务信息,具体值要和支付平台约定,应用于安全,营销等参数直传场景,格式为json格式",
|
||||
example = "{\"mc_create_trade_ip\":\"127.0.0.1\"}"
|
||||
)
|
||||
@Length(max = 512)
|
||||
@@ -84,7 +84,7 @@ public class PayTradeWapPayRequest {
|
||||
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝。",
|
||||
value = "公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付平台只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付平台。",
|
||||
example = "merchantBizType%3d3C%26merchantBizNo%3d2016010101111"
|
||||
)
|
||||
@Length(max = 512)
|
||||
@@ -137,7 +137,7 @@ public class PayTradeWapPayRequest {
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "支付宝定义的统一商品编号",
|
||||
value = "支付平台定义的统一商品编号",
|
||||
example = "20010001"
|
||||
)
|
||||
@Length(max = 32)
|
||||
|
@@ -0,0 +1,23 @@
|
||||
package com.gitee.sop.payment.open.resp;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 六如
|
||||
*/
|
||||
@Data
|
||||
public class PayOrderSearchResponse {
|
||||
|
||||
@ApiModelProperty(value = "订单编号", example = "xxxx")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "支付编号", example = "xxxx")
|
||||
private String payNo;
|
||||
|
||||
@ApiModelProperty(value = "支付人id", example = "111")
|
||||
private Long payUserId;
|
||||
|
||||
@ApiModelProperty(value = "支付人姓名", example = "Jim")
|
||||
private String payUserName;
|
||||
}
|
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
public class PayTradeWapPayResponse {
|
||||
|
||||
@ApiModelProperty(
|
||||
value = "用于跳转支付宝页面的信息,POST和GET方法生成内容不同:使用POST方法执行,结果为html form表单,在浏览器渲染即可;使用GET方法会得到支付宝URL,需要打开或重定向到该URL。建议使用POST方式。具体使用方法请参考",
|
||||
value = "用于跳转支付平台页面的信息,POST和GET方法生成内容不同:使用POST方法执行,结果为html form表单,在浏览器渲染即可;使用GET方法会得到支付平台URL,需要打开或重定向到该URL。建议使用POST方式。具体使用方法请参考",
|
||||
required = true,
|
||||
example = "请参考响应示例"
|
||||
)
|
||||
|
Reference in New Issue
Block a user