|
@@ -109,29 +109,27 @@ public class OrderPayServiceImpl implements IOrderPayService {
|
|
List<GamePayWayDTO> gamePayWayList = gamePayWayService.listOfGameId(userData.getGameId());
|
|
List<GamePayWayDTO> gamePayWayList = gamePayWayService.listOfGameId(userData.getGameId());
|
|
//支付方式
|
|
//支付方式
|
|
GamePayWayDTO gamePayWayDTO = null;
|
|
GamePayWayDTO gamePayWayDTO = null;
|
|
- //IOS用户
|
|
|
|
- if (Objects.equals(userData.getDeviceSystem(), DeviceTypeEnum.DEVICE_TYPE_IOS.getDescribe())) {
|
|
|
|
- //返回小程序商城支付
|
|
|
|
|
|
+ //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 ->
|
|
gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.APPLET_PAY.getPayDeviceId()))
|
|
Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.APPLET_PAY.getPayDeviceId()))
|
|
.findFirst().orElse(null);
|
|
.findFirst().orElse(null);
|
|
}
|
|
}
|
|
- //android用户
|
|
|
|
- if (Objects.equals(userData.getDeviceSystem(), DeviceTypeEnum.DEVICE_TYPE_ANDROID.getDescribe())) {
|
|
|
|
- //返回米大师支付
|
|
|
|
|
|
+ //兜底适配, 适配客服支付
|
|
|
|
+ if (gamePayWayDTO == null) {
|
|
gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
gamePayWayDTO = gamePayWayList.stream().filter(gamePayWay ->
|
|
- Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.MI_PAY.getPayDeviceId()))
|
|
|
|
|
|
+ Objects.equals(gamePayWay.getPayDeviceId(), PayDeviceEnum.CUSTOM_PAY.getPayDeviceId()))
|
|
.findFirst().orElse(null);
|
|
.findFirst().orElse(null);
|
|
}
|
|
}
|
|
//返回适配的支付方式
|
|
//返回适配的支付方式
|
|
if (gamePayWayDTO != null) {
|
|
if (gamePayWayDTO != null) {
|
|
- return gamePayWayDTO.getPayDeviceId();
|
|
|
|
- }
|
|
|
|
- //未匹配到, 尝试匹配客服支付
|
|
|
|
- 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();
|
|
return gamePayWayDTO.getPayDeviceId();
|
|
}
|
|
}
|
|
//未匹配到任何合适的支付方式
|
|
//未匹配到任何合适的支付方式
|