diff --git a/rc-service/rc-service-order/order-application/src/main/java/com/red/circle/order/app/command/pay/web/UserProfileAndCountryQueryExe.java b/rc-service/rc-service-order/order-application/src/main/java/com/red/circle/order/app/command/pay/web/UserProfileAndCountryQueryExe.java index b0804144..eb2a54c1 100644 --- a/rc-service/rc-service-order/order-application/src/main/java/com/red/circle/order/app/command/pay/web/UserProfileAndCountryQueryExe.java +++ b/rc-service/rc-service-order/order-application/src/main/java/com/red/circle/order/app/command/pay/web/UserProfileAndCountryQueryExe.java @@ -104,6 +104,12 @@ public class UserProfileAndCountryQueryExe { PayCountry compatiblePayCountry = payCountryAliasResolver .resolvePayCountryByCountryId(countryCode.getId()); + boolean freightUser = existsFreightBalance(userProfile.getId()); + webSiteUseProfile + .setFreightUser(freightUser) + // Yumi H5 先确认用户身份,再用这里返回的商品类型查询后台商品,避免币商误买普通金币商品后入普通金币账户. + .setCommodityType(freightUser ? PayApplicationCommodityType.FREIGHT_GOLD.name() + : PayApplicationCommodityType.GOLD.name()); // LIKEI/Yumi 的支付国家开放由 H5 JSON 控制;这里仅返回用户真实国家,商品接口再按国家码查该国商品. PayCountryCO payCountryCO = new PayCountryCO() @@ -119,6 +125,12 @@ public class UserProfileAndCountryQueryExe { .setRegionId(regionId); } + private boolean existsFreightBalance(Long userId) { + return Boolean.TRUE.equals(ResponseAssert.requiredSuccess( + freightGoldClient.existsBalance(userId) + )); + } + private SysCountryCodeDTO getUserCountryCode(UserProfileDTO userProfile) { if (Objects.nonNull(userProfile.getCountryId())) { return ResponseAssert.requiredSuccess( diff --git a/rc-service/rc-service-order/order-client/src/main/java/com/red/circle/order/app/dto/clientobject/pay/WebSiteUseProfileCO.java b/rc-service/rc-service-order/order-client/src/main/java/com/red/circle/order/app/dto/clientobject/pay/WebSiteUseProfileCO.java index 644fd591..af3a7eee 100644 --- a/rc-service/rc-service-order/order-client/src/main/java/com/red/circle/order/app/dto/clientobject/pay/WebSiteUseProfileCO.java +++ b/rc-service/rc-service-order/order-client/src/main/java/com/red/circle/order/app/dto/clientobject/pay/WebSiteUseProfileCO.java @@ -44,12 +44,22 @@ public class WebSiteUseProfileCO extends ClientObject { */ private String account; - /** - * 归属平台. - */ - private String sysOrigin; - - public static WebSiteUseProfileCO toWebSiteUseProfileCO(UserProfileDTO userProfile) { + /** + * 归属平台. + */ + private String sysOrigin; + + /** + * 是否存在货运金币账户;Yumi H5 用这个身份决定展示普通金币还是货运金币商品. + */ + private Boolean freightUser; + + /** + * 本次 H5 充值应该请求的商品类型,普通用户是 GOLD,货运/币商用户是 FREIGHT_GOLD. + */ + private String commodityType; + + public static WebSiteUseProfileCO toWebSiteUseProfileCO(UserProfileDTO userProfile) { if (userProfile == null) { return null; }