修改支付接口

20240115-ljl-multiPay
ljl 1 year ago
parent 949b822f33
commit 28e645586c

@ -20,7 +20,7 @@ public interface DsApiService {
BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request); BatchAddDsPurchaseConfirmLogResponseDTO batchAddPurchaseConfirmLog(Long shopId, BatchAddPurchaseConfirmLogRequestDTO request);
CommonResponseDTO cancelPurchaseOrderRelate(String platform, Long shopId, String orderId, List<Long> skuIds); CommonResponseDTO cancelPurchaseOrderRelate(String platform, Long shopId, String orderId, List<Long> skuIds);
CommonResponseDTO cancelPurchaseOrder(String platform, Long shopId, String orderId, String purchaseOrderSn); CommonResponseDTO cancelPurchaseOrder(String platform, Long shopId, String orderId, String purchaseOrderSn);
GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List<String> sourceOrderId, Long shopId); GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(Long shopId, List<String> sourceOrderIds, String payPlatformType);
GetPlatformAuthUrlResponseDTO getPlatformAuthUrl(ShopBO shopBO); GetPlatformAuthUrlResponseDTO getPlatformAuthUrl(ShopBO shopBO);
GetSourceItemInfosResponseDTO getSourceItemInfos(Long shopId, List<String> sourceItemIds); GetSourceItemInfosResponseDTO getSourceItemInfos(Long shopId, List<String> sourceItemIds);
GetAuthInfoResponseDTO getAuthInfo(Long shopId); GetAuthInfoResponseDTO getAuthInfo(Long shopId);

@ -472,24 +472,28 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
List<PaymentResult> paymentResults = new ArrayList<>(); List<PaymentResult> paymentResults = new ArrayList<>();
for (BatchPayParam.Param p: param.getParams()) { for (BatchPayParam.Param p: param.getParams()) {
GetPurchaseOrderPayUrlResponseDTO response = dsApiService.getPurchaseOrderPayUrl(Collections.singletonList(purchaseOrder.getPurchaseOrderSn()), p.getShopId()); List<String> sourceOrderIds = Collections.singletonList(purchaseOrder.getPurchaseOrderSn());
if (response.isSuccess()) { GetPurchaseOrderPayUrlResponseDTO response1 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "PC");
GetPurchaseOrderPayUrlResponseDTO response2 = dsApiService.getPurchaseOrderPayUrl(p.getShopId(), sourceOrderIds, "WIRELESS");
if (!response1.isSuccess()) {
throw new RuntimeException(response1.getReason());
}
if (!response2.isSuccess()) {
throw new RuntimeException(response2.getReason());
}
PaymentResult paymentResult = new PaymentResult(); PaymentResult paymentResult = new PaymentResult();
PaymentResult.PayUrl payUrl = new PaymentResult.PayUrl(); PaymentResult.PayUrl payUrl = new PaymentResult.PayUrl();
payUrl.setH5Url(response.getPayUrl());
payUrl.setPcUrl(response.getPayUrl()); payUrl.setPcUrl(response1.getPayUrl());
payUrl.setH5Url(response2.getPayUrl());
paymentResult.setPayUrl(payUrl); paymentResult.setPayUrl(payUrl);
paymentResult.setPurOrderId(p.getPurOrderId()); paymentResult.setPurOrderId(p.getPurOrderId());
paymentResults.add(paymentResult); paymentResults.add(paymentResult);
platformPurchaseOrder.setPayPcUrl(response.getPayUrl()); platformPurchaseOrder.setPayPcUrl(response1.getPayUrl());
platformPurchaseOrder.setPayH5Url(response.getPayUrl()); platformPurchaseOrder.setPayH5Url(response2.getPayUrl());
platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder); platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder);
} else {
throw new RuntimeException(response.getReason());
}
} }
data.setPaymentResults(paymentResults); data.setPaymentResults(paymentResults);
} }

@ -103,11 +103,12 @@ public class DsApiServiceImpl implements DsApiService {
} }
@Override @Override
public GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List<String> sourceOrderId, Long shopId) { public GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(Long shopId, List<String> sourceOrderIds, String payPlatformType) {
OperateInfoDTO operateInfo = createOperateInfo(shopId); OperateInfoDTO operateInfo = createOperateInfo(shopId);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("sourceOrderId", sourceOrderId); params.put("sourceOrderId", sourceOrderIds);
params.put("operateInfo", operateInfo); params.put("operateInfo", operateInfo);
params.put("payPlatformType", payPlatformType);
String resp = execute("/order/getPurchaseOrderPayUrl", params); String resp = execute("/order/getPurchaseOrderPayUrl", params);
return JSON.parseObject(resp, GetPurchaseOrderPayUrlResponseDTO.class); return JSON.parseObject(resp, GetPurchaseOrderPayUrlResponseDTO.class);
} }

Loading…
Cancel
Save