|
@@ -113,37 +113,36 @@ public class OrderPayServiceImpl implements IOrderPayService {
|
|
|
@Override
|
|
|
public Long getAppletPayDevice(UserData userData) {
|
|
|
log.error("获取支付类型参数, 请求信息 userData : {}", JsonUtil.toString(userData));
|
|
|
- return 4L;
|
|
|
-// //查询游戏配置的支付方式
|
|
|
-// List<GamePayWayDTO> gamePayWayList = gamePayWayService.listOfGameId(userData.getGameId());
|
|
|
-// //支付方式
|
|
|
-// GamePayWayDTO gamePayWayDTO = null;
|
|
|
-// //android用户, 游戏适配米大师支付
|
|
|
-// if (Objects.equals(userData.getDeviceSystem(), DeviceTypeEnum.DEVICE_TYPE_ANDROID.getDescribe())) {
|
|
|
-// gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
-// Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.MI_PAY.getPayDeviceId()))
|
|
|
-// .findFirst().orElse(null);
|
|
|
-// }
|
|
|
-// //非android用户, 或者未适配到米大师支付, 适配小程序商城支付
|
|
|
-// if (gamePayWayDTO == null) {
|
|
|
-// gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
-// Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.APPLET_PAY.getPayDeviceId()))
|
|
|
-// .findFirst().orElse(null);
|
|
|
-// }
|
|
|
-// //兜底适配, 适配客服支付
|
|
|
-// if (gamePayWayDTO == null) {
|
|
|
-// gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
-// Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.CUSTOM_PAY.getPayDeviceId()))
|
|
|
-// .findFirst().orElse(null);
|
|
|
-// }
|
|
|
-// //返回适配的支付方式
|
|
|
-// if (gamePayWayDTO != null) {
|
|
|
-// log.error("返回适配的支付方式, deviceSystem : {}, payDeviceId : {}", userData.getDeviceSystem(), gamePayWayDTO.getPayDeviceId());
|
|
|
-// return gamePayWayDTO.getPayDeviceId();
|
|
|
-// }
|
|
|
-// //未匹配到任何合适的支付方式
|
|
|
-// log.error("数据错误, 未匹配到合适的支付方式, userData : {}", JsonUtil.toString(userData));
|
|
|
-// throw new BaseException("数据错误, 未匹配到合适的支付方式");
|
|
|
+ //查询游戏配置的支付方式
|
|
|
+ List<GamePayWayDTO> gamePayWayList = gamePayWayService.listOfGameId(userData.getGameId());
|
|
|
+ //支付方式
|
|
|
+ GamePayWayDTO gamePayWayDTO = null;
|
|
|
+ //android用户, 游戏适配米大师支付
|
|
|
+ if (Objects.equals(userData.getDeviceSystem(), DeviceTypeEnum.DEVICE_TYPE_ANDROID.getDescribe())) {
|
|
|
+ gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
+ Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.MI_PAY.getPayDeviceId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ }
|
|
|
+ //非android用户, 或者未适配到米大师支付, 适配小程序商城支付
|
|
|
+ if (gamePayWayDTO == null) {
|
|
|
+ gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
+ Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.APPLET_PAY.getPayDeviceId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ }
|
|
|
+ //兜底适配, 适配客服支付
|
|
|
+ if (gamePayWayDTO == null) {
|
|
|
+ gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
|
+ Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.CUSTOM_PAY.getPayDeviceId()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ }
|
|
|
+ //返回适配的支付方式
|
|
|
+ if (gamePayWayDTO != null) {
|
|
|
+ log.error("返回适配的支付方式, deviceSystem : {}, payDeviceId : {}", userData.getDeviceSystem(), gamePayWayDTO.getPayDeviceId());
|
|
|
+ return gamePayWayDTO.getPayDeviceId();
|
|
|
+ }
|
|
|
+ //未匹配到任何合适的支付方式
|
|
|
+ log.error("数据错误, 未匹配到合适的支付方式, userData : {}", JsonUtil.toString(userData));
|
|
|
+ throw new BaseException("数据错误, 未匹配到合适的支付方式");
|
|
|
}
|
|
|
|
|
|
@Override
|