code review 支付相关的代码实现
parent
7d6f205dc0
commit
b18cd457c8
|
@ -15,6 +15,7 @@ import java.util.Map;
|
|||
@Builder
|
||||
public class PayNotifyDataDTO {
|
||||
|
||||
// TODO @jason:使用 /** */ 的形式注释哈
|
||||
//返回的所有参数
|
||||
private String body;
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@ public abstract class AbstractPayClient<Config extends PayClientConfig> implemen
|
|||
|
||||
@Override
|
||||
public PayRefundUnifiedRespDTO unifiedRefund(PayRefundUnifiedReqDTO reqDTO) {
|
||||
|
||||
PayRefundUnifiedRespDTO resp;
|
||||
try {
|
||||
resp = doUnifiedRefund(reqDTO);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.framework.pay.core.enums;
|
||||
|
||||
// TODO @芋艿:感觉情况有点多,得讨论下
|
||||
/**
|
||||
* 统一的渠道返回结果
|
||||
* @author jason
|
||||
|
|
|
@ -25,6 +25,7 @@ public class AlipayQrPayClientTest extends BaseMockitoUnitTest {
|
|||
.setAppId("2021000118634035")
|
||||
.setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX)
|
||||
.setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT)
|
||||
// TODO @tina:key 可以随机就好,简洁一点哈。
|
||||
.setPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJ" +
|
||||
"v890x84qbppUtRIfhaKSwSVN0thCcsDCaAsGR5MZslDkO8NCT9V4r2SVXjyY7eJUZlZd1M0C8T" +
|
||||
"01Tg4UOx5LUbic0O3A1uJMy6V1n9IyYwbAW3AEZhBd5bSbPgrqvmv3NeWSTQT6Anxnllf+2iDH" +
|
||||
|
@ -50,8 +51,8 @@ public class AlipayQrPayClientTest extends BaseMockitoUnitTest {
|
|||
"gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBN" +
|
||||
"lrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZ" +
|
||||
"ikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB");
|
||||
// 创建客户端
|
||||
|
||||
// TODO @tina:= 前后要有空格哈
|
||||
@InjectMocks
|
||||
AlipayQrPayClient client=new AlipayQrPayClient(10L,config);
|
||||
|
||||
|
@ -66,7 +67,8 @@ public class AlipayQrPayClientTest extends BaseMockitoUnitTest {
|
|||
}
|
||||
@Test
|
||||
public void create() throws AlipayApiException {
|
||||
|
||||
// TODO @tina:参数可以尽量随机一点,使用随机方法。这样的好处是,避免对固定参数的依赖,导致可能仅仅满足固定参数的结果
|
||||
// 这里,设置可以直接随机整个对象。
|
||||
Long shopOrderId = System.currentTimeMillis();
|
||||
PayOrderUnifiedReqDTO reqDTO=new PayOrderUnifiedReqDTO();
|
||||
reqDTO.setMerchantOrderId(String.valueOf(System.currentTimeMillis()));
|
||||
|
@ -88,6 +90,7 @@ public class AlipayQrPayClientTest extends BaseMockitoUnitTest {
|
|||
// 断言
|
||||
assertEquals(response.getCode(), result.getApiCode());
|
||||
assertEquals(response.getMsg(), result.getApiMsg());
|
||||
// TODO @tina:这个断言木有过?
|
||||
assertEquals(GlobalErrorCodeConstants.SUCCESS.getCode(), result.getCode());
|
||||
assertEquals(GlobalErrorCodeConstants.SUCCESS.getMsg(), result.getMsg());
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ public class PayRefundReqVO {
|
|||
@NotEmpty(message = "退款金额")
|
||||
private Long amount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "退款原因", required = true, example = "不喜欢")
|
||||
@NotEmpty(message = "退款原因")
|
||||
private String reason;
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.mapstruct.Mapper;
|
|||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 支付退款 Convert
|
||||
* 支付退款 Convert // TODO @jason:类注释,和下面,有一个空行哈
|
||||
* @author jason
|
||||
*/
|
||||
@Mapper
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ShopOrderController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// TODO @jason:方法之间,空一行即可哈
|
||||
@PostMapping("/pay-notify")
|
||||
@ApiOperation("支付回调")
|
||||
public CommonResult<Boolean> payNotify(@RequestBody @Valid PayNotifyOrderReqVO reqVO) {
|
||||
|
|
Loading…
Reference in New Issue