| | |
| | | putIfPresent(request, "settle_cert_front_pic", command.settlementCertificateFrontPictureId()); |
| | | putIfPresent(request, "settle_cert_back_pic", command.settlementCertificateBackPictureId()); |
| | | request.put("cash_config", JSON.toJSONString(List.of(cash))); |
| | | request.put("settle_config", JSON.toJSONString(settleConfig())); |
| | | putIfPresent(request, "async_return_url", properties.getMerchantOnboardingNotifyUrl()); |
| | | try { |
| | | synchronized (SDK_LOCK) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 结算配置:进件即打开自动结算,让核销确认后的钱由斗拱按结算周期自动划到结算卡, |
| | | * 商户和平台都不需要再手工发起出款。 |
| | | * |
| | | * <p>不设起结金额与留存金额:一笔 1 分钱也要能结出去。结算周期由渠道商开通的业务类型决定, |
| | | * 当前可用的是 D1(次自然日到账)。 |
| | | */ |
| | | static Map<String, Object> settleConfig() { |
| | | Map<String, Object> settle = new LinkedHashMap<>(); |
| | | settle.put("settle_status", "1"); |
| | | settle.put("settle_cycle", "D1"); |
| | | settle.put("settle_pattern", "P0"); |
| | | settle.put("min_amt", "0.00"); |
| | | settle.put("remained_amt", "0.00"); |
| | | settle.put("out_settle_flag", "2"); |
| | | settle.put("fee_rate", "0.00"); |
| | | return settle; |
| | | } |
| | | |
| | | private void ensureConfigured() { |
| | | if (!properties.isEnabled()) throw new BusinessException(ErrorCode.CONFLICT, "Huifu payment is disabled"); |
| | | if (blank(properties.getSystemId()) || blank(properties.getProductId()) || blank(properties.getOnboardingUpperHuifuId()) || blank(properties.getPrivateKey()) || blank(properties.getPlatformPublicKey())) throw new BusinessException(ErrorCode.CONFLICT, "Huifu merchant onboarding configuration is incomplete"); |