|
@@ -8,24 +8,20 @@ import com.yoho.error.exception.ServiceException; |
|
@@ -8,24 +8,20 @@ import com.yoho.error.exception.ServiceException; |
8
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
8
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
9
|
import com.yohobuy.ufo.model.order.common.Payment;
|
9
|
import com.yohobuy.ufo.model.order.common.Payment;
|
10
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
10
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
11
|
-import com.yohoufo.common.utils.DateUtil;
|
|
|
12
|
-import com.yohoufo.common.utils.HttpClient;
|
|
|
13
|
-import com.yohoufo.common.utils.MD5Utils;
|
|
|
14
|
-import com.yohoufo.common.utils.RSAUtils;
|
|
|
15
|
-import com.yohoufo.common.utils.WXUtil;
|
11
|
+import com.yohoufo.common.utils.*;
|
16
|
import com.yohoufo.dal.order.OrdersPayHbfqMapper;
|
12
|
import com.yohoufo.dal.order.OrdersPayHbfqMapper;
|
17
|
import com.yohoufo.dal.order.model.OrdersPayHbfq;
|
13
|
import com.yohoufo.dal.order.model.OrdersPayHbfq;
|
18
|
-import com.yohoufo.dal.order.model.TradeBills;
|
|
|
19
|
import com.yohoufo.order.common.HbfqEnum;
|
14
|
import com.yohoufo.order.common.HbfqEnum;
|
20
|
import com.yohoufo.order.config.AlipayConfig;
|
15
|
import com.yohoufo.order.config.AlipayConfig;
|
21
|
import com.yohoufo.order.constants.RefundContant;
|
16
|
import com.yohoufo.order.constants.RefundContant;
|
22
|
-import com.yohoufo.order.model.*;
|
17
|
+import com.yohoufo.order.model.PayQueryBo;
|
|
|
18
|
+import com.yohoufo.order.model.PayRefundBo;
|
|
|
19
|
+import com.yohoufo.order.model.PaymentData;
|
|
|
20
|
+import com.yohoufo.order.model.TransferData;
|
23
|
import com.yohoufo.order.service.pay.AbstractPayService;
|
21
|
import com.yohoufo.order.service.pay.AbstractPayService;
|
24
|
import com.yohoufo.order.service.transfer.TransferChannel;
|
22
|
import com.yohoufo.order.service.transfer.TransferChannel;
|
25
|
import com.yohoufo.order.service.transfer.TransferResult;
|
23
|
import com.yohoufo.order.service.transfer.TransferResult;
|
26
|
import com.yohoufo.order.utils.AlipayExceedMillionTransferErrors;
|
24
|
import com.yohoufo.order.utils.AlipayExceedMillionTransferErrors;
|
27
|
-import lombok.Builder;
|
|
|
28
|
-import lombok.Data;
|
|
|
29
|
import org.apache.commons.lang3.StringUtils;
|
25
|
import org.apache.commons.lang3.StringUtils;
|
30
|
import org.slf4j.Logger;
|
26
|
import org.slf4j.Logger;
|
31
|
import org.slf4j.LoggerFactory;
|
27
|
import org.slf4j.LoggerFactory;
|
|
@@ -39,7 +35,6 @@ import java.nio.charset.StandardCharsets; |
|
@@ -39,7 +35,6 @@ import java.nio.charset.StandardCharsets; |
39
|
import java.text.SimpleDateFormat;
|
35
|
import java.text.SimpleDateFormat;
|
40
|
import java.util.*;
|
36
|
import java.util.*;
|
41
|
import java.util.function.BiConsumer;
|
37
|
import java.util.function.BiConsumer;
|
42
|
-import java.util.function.Supplier;
|
|
|
43
|
|
38
|
|
44
|
public abstract class AlipayServiceAbstract extends AbstractPayService {
|
39
|
public abstract class AlipayServiceAbstract extends AbstractPayService {
|
45
|
|
40
|
|
|
@@ -204,7 +199,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
@@ -204,7 +199,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
204
|
String alipayUid;
|
199
|
String alipayUid;
|
205
|
String alipayAccount;
|
200
|
String alipayAccount;
|
206
|
BigDecimal transferAmount;
|
201
|
BigDecimal transferAmount;
|
207
|
- BiConsumer<Integer, String> rishWatcherConsumer;
|
202
|
+ BiConsumer<Integer, AuthorizeResultRespVO> rishWatcherConsumer;
|
208
|
|
203
|
|
209
|
private AlipayTransfer(int uid){
|
204
|
private AlipayTransfer(int uid){
|
210
|
this.uid = uid;
|
205
|
this.uid = uid;
|
|
@@ -230,14 +225,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
@@ -230,14 +225,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
230
|
return this;
|
225
|
return this;
|
231
|
}
|
226
|
}
|
232
|
|
227
|
|
233
|
- public AlipayTransfer riskWatcher(BiConsumer<Integer, String> rishWatcherConsumer){
|
228
|
+ public AlipayTransfer riskWatcher(BiConsumer<Integer, AuthorizeResultRespVO> rishWatcherConsumer){
|
234
|
this.rishWatcherConsumer = rishWatcherConsumer;
|
229
|
this.rishWatcherConsumer = rishWatcherConsumer;
|
235
|
return this;
|
230
|
return this;
|
236
|
}
|
231
|
}
|
237
|
|
232
|
|
238
|
@Override
|
233
|
@Override
|
239
|
public TransferResult transfer() {
|
234
|
public TransferResult transfer() {
|
240
|
- rishWatcherConsumer.accept(uid, alipayUid);
|
235
|
+ AuthorizeResultRespVO aar = AuthorizeResultRespVO.builder().alipayId(alipayUid)
|
|
|
236
|
+ .alipayAccount(alipayAccount).build();
|
|
|
237
|
+ rishWatcherConsumer.accept(uid, aar);
|
241
|
Map<String, String> queryParams = buildTransferParams(transferOrderCode, alipayUid, alipayAccount, transferAmount);
|
238
|
Map<String, String> queryParams = buildTransferParams(transferOrderCode, alipayUid, alipayAccount, transferAmount);
|
242
|
String respTxt;
|
239
|
String respTxt;
|
243
|
try {
|
240
|
try {
|
|
@@ -328,7 +325,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
@@ -328,7 +325,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
328
|
BigDecimal transferAmount;
|
325
|
BigDecimal transferAmount;
|
329
|
String businessId;
|
326
|
String businessId;
|
330
|
String userName;
|
327
|
String userName;
|
331
|
- BiConsumer<Integer, String> riskWatcher;
|
328
|
+ BiConsumer<Integer, AuthorizeResultRespVO> riskWatcher;
|
332
|
private AlipayExceedMillionTransferChannel(int uid){
|
329
|
private AlipayExceedMillionTransferChannel(int uid){
|
333
|
this.uid = uid;
|
330
|
this.uid = uid;
|
334
|
}
|
331
|
}
|
|
@@ -363,14 +360,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
|
@@ -363,14 +360,16 @@ public abstract class AlipayServiceAbstract extends AbstractPayService { |
363
|
return this;
|
360
|
return this;
|
364
|
}
|
361
|
}
|
365
|
|
362
|
|
366
|
- public AlipayExceedMillionTransferChannel riskWatcher(BiConsumer<Integer, String> riskWatcher){
|
363
|
+ public AlipayExceedMillionTransferChannel riskWatcher(BiConsumer<Integer, AuthorizeResultRespVO> riskWatcher){
|
367
|
this.riskWatcher = riskWatcher;
|
364
|
this.riskWatcher = riskWatcher;
|
368
|
return this;
|
365
|
return this;
|
369
|
}
|
366
|
}
|
370
|
|
367
|
|
371
|
@Override
|
368
|
@Override
|
372
|
public TransferResult transfer() {
|
369
|
public TransferResult transfer() {
|
373
|
- riskWatcher.accept(uid, alipayUid);
|
370
|
+ AuthorizeResultRespVO aar = AuthorizeResultRespVO.builder().alipayId(alipayUid)
|
|
|
371
|
+ .alipayAccount(alipayAccount).build();
|
|
|
372
|
+ riskWatcher.accept(uid, aar);
|
374
|
Map<String, String> queryParams = buildTransferParamsWhenExceedMillion(transferOrderCode, businessId, alipayUid, alipayAccount, userName, transferAmount);
|
373
|
Map<String, String> queryParams = buildTransferParamsWhenExceedMillion(transferOrderCode, businessId, alipayUid, alipayAccount, userName, transferAmount);
|
375
|
String respTxt;
|
374
|
String respTxt;
|
376
|
try {
|
375
|
try {
|