@ -6,6 +6,7 @@ import au.com.royalpay.payment.manage.activities.app_index.core.AppActService;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper ;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper ;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper ;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper ;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean ;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean ;
import au.com.royalpay.payment.manage.appclient.beans.AppPaymentConfigBean ;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean ;
import au.com.royalpay.payment.manage.appclient.beans.AppQueryBean ;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService ;
import au.com.royalpay.payment.manage.appclient.core.RetailAppService ;
import au.com.royalpay.payment.manage.cashback.core.CashbackService ;
import au.com.royalpay.payment.manage.cashback.core.CashbackService ;
@ -93,6 +94,7 @@ import org.thymeleaf.spring5.SpringTemplateEngine;
import java.awt.image.BufferedImage ;
import java.awt.image.BufferedImage ;
import java.io.* ;
import java.io.* ;
import java.lang.reflect.Array ;
import java.math.BigDecimal ;
import java.math.BigDecimal ;
import java.math.RoundingMode ;
import java.math.RoundingMode ;
import java.text.DateFormat ;
import java.text.DateFormat ;
@ -110,6 +112,7 @@ import java.util.TimeZone;
import java.util.concurrent.LinkedBlockingQueue ;
import java.util.concurrent.LinkedBlockingQueue ;
import java.util.concurrent.ThreadPoolExecutor ;
import java.util.concurrent.ThreadPoolExecutor ;
import java.util.concurrent.TimeUnit ;
import java.util.concurrent.TimeUnit ;
import java.util.stream.Collectors ;
import javax.annotation.Resource ;
import javax.annotation.Resource ;
import javax.servlet.ServletOutputStream ;
import javax.servlet.ServletOutputStream ;
@ -352,7 +355,7 @@ public class RetailAppServiceImp implements RetailAppService {
}
}
@Override
@Override
public void changeSurchargeEnable ( JSONObject device , UpdateSurchargeDTO updateSurchargeDTO ) {
public void changeSurchargeEnable ( JSONObject device , AppPaymentConfigBean appPaymentConfigBean ) {
JSONObject client = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
JSONObject client = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
if ( PartnerRole . getRole ( account . getIntValue ( "role" ) ) ! = PartnerRole . ADMIN ) {
if ( PartnerRole . getRole ( account . getIntValue ( "role" ) ) ! = PartnerRole . ADMIN ) {
@ -361,17 +364,65 @@ public class RetailAppServiceImp implements RetailAppService {
if ( client = = null ) {
if ( client = = null ) {
throw new NotFoundException ( "Client not found, please check" ) ;
throw new NotFoundException ( "Client not found, please check" ) ;
}
}
if ( updateSurchargeDTO . getApiSurcharge ( ) ! = null ) {
if ( appPaymentConfigBean . getApiSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "api_surcharge" , updateSurchargeDTO . getApiSurcharge ( ) ) ) ;
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "api_surcharge" , appPaymentConfigBean . getApiSurcharge ( ) ) ) ;
}
}
if ( updateSurchargeDTO . getQrcodeSurcharge ( ) ! = null ) {
if ( appPaymentConfigBean . getQrcodeSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "qrcode_surcharge" , updateSurchargeDTO . getQrcodeSurcharge ( ) ) ) ;
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "qrcode_surcharge" , appPaymentConfigBean . getQrcodeSurcharge ( ) ) ) ;
}
}
if ( updateSurchargeDTO . getRetailSurcharge ( ) ! = null ) {
if ( appPaymentConfigBean . getRetailSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "retail_surcharge" , updateSurchargeDTO . getRetailSurcharge ( ) ) ) ;
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "retail_surcharge" , appPaymentConfigBean . getRetailSurcharge ( ) ) ) ;
}
if ( appPaymentConfigBean . getRequireRemark ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "require_remark" , appPaymentConfigBean . getRequireRemark ( ) ) ) ;
}
if ( appPaymentConfigBean . getRequireCustinfo ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , client . getString ( "client_moniker" ) , "require_custinfo" , appPaymentConfigBean . getRequireCustinfo ( ) ) ) ;
}
}
@Override
public void changePaymentConfigByMoniker ( JSONObject device , String clientMoniker , AppPaymentConfigBean appPaymentConfigBean ) {
JSONObject client = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
if ( PartnerRole . getRole ( account . getIntValue ( "role" ) ) ! = PartnerRole . ADMIN ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
if ( client = = null ) {
throw new NotFoundException ( "Client not found, please check" ) ;
}
boolean isSubPartner = isSubPartner ( device , clientMoniker ) ;
if ( ! isSubPartner ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
if ( appPaymentConfigBean . getApiSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , clientMoniker , "api_surcharge" , appPaymentConfigBean . getApiSurcharge ( ) ) ) ;
}
if ( appPaymentConfigBean . getQrcodeSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , clientMoniker , "qrcode_surcharge" , appPaymentConfigBean . getQrcodeSurcharge ( ) ) ) ;
}
if ( appPaymentConfigBean . getRetailSurcharge ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , clientMoniker , "retail_surcharge" , appPaymentConfigBean . getRetailSurcharge ( ) ) ) ;
}
if ( appPaymentConfigBean . getRequireRemark ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , clientMoniker , "require_remark" , appPaymentConfigBean . getRequireRemark ( ) ) ) ;
}
if ( appPaymentConfigBean . getRequireCustinfo ( ) ! = null ) {
clientModifySupport . processClientConfigModify (
new SwitchPermissionModify ( account , clientMoniker , "require_custinfo" , appPaymentConfigBean . getRequireCustinfo ( ) ) ) ;
}
}
}
}
@ -429,6 +480,18 @@ public class RetailAppServiceImp implements RetailAppService {
return clientManager . getAuthFiles ( account , client . getString ( "client_moniker" ) ) ;
return clientManager . getAuthFiles ( account , client . getString ( "client_moniker" ) ) ;
}
}
@Override
public JSONObject getAuthFilesByMoniker ( JSONObject device , String clientMoniker ) {
if ( ! isSubPartner ( device , clientMoniker ) ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new NotFoundException ( "Client not found, please check" ) ;
}
return clientManager . getAllAuthFiles ( null , clientMoniker ) ;
}
@Override
@Override
public void uploadAuthFiles ( JSONObject device , ClientAuthFilesInfo clientAuthFilesInfo ) {
public void uploadAuthFiles ( JSONObject device , ClientAuthFilesInfo clientAuthFilesInfo ) {
JSONObject client = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
JSONObject client = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
@ -593,7 +656,24 @@ public class RetailAppServiceImp implements RetailAppService {
throw new ForbiddenException ( "You have no permission" ) ;
throw new ForbiddenException ( "You have no permission" ) ;
}
}
clientManager . updateAppClient ( account , device . getIntValue ( "client_id" ) , appClientBean ) ;
clientManager . updateAppClient ( account , device . getIntValue ( "client_id" ) , appClientBean ) ;
}
@Override
public void updateClientByMoniker ( JSONObject device , String clientMoniker , AppClientBean appClientBean ) {
String clientType = device . getString ( "client_type" ) ;
deviceSupport . findRegister ( clientType ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
if ( device . getIntValue ( "client_id" ) ! = account . getIntValue ( "client_id" ) | | PartnerRole . getRole ( account . getIntValue ( "role" ) ) = = PartnerRole . CASHIER ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
if ( ! isSubPartner ( device , clientMoniker ) ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new NotFoundException ( "Client not found, please check" ) ;
}
clientManager . updateAppClient ( account , client . getIntValue ( "client_id" ) , appClientBean ) ;
}
}
@Override
@Override
@ -602,30 +682,25 @@ public class RetailAppServiceImp implements RetailAppService {
deviceSupport . findRegister ( clientType ) ;
deviceSupport . findRegister ( clientType ) ;
JSONObject clientWithConfig = clientMapper . findClient ( device . getIntValue ( "client_id" ) ) ;
JSONObject clientWithConfig = clientMapper . findClient ( device . getIntValue ( "client_id" ) ) ;
clientWithConfig . putAll ( clientConfigService . find ( device . getIntValue ( "client_id" ) ) ) ;
clientWithConfig . putAll ( clientConfigService . find ( device . getIntValue ( "client_id" ) ) ) ;
JSONObject res = SignInAccountServiceImpl . clientInfoWithNoSecretInfo ( clientWithConfig ) ;
JSONObject res = getClientBaseInfo ( clientWithConfig ) ;
res . put ( "is_skip_clearing" , res . getBoolean ( "skip_clearing" ) ) ;
if ( clientType . equals ( "iphone" ) ) {
if ( clientType . equals ( "iphone" ) ) {
res . put ( "skip_clearing" , ! res . getBoolean ( "skip_clearing" ) ) ;
res . put ( "skip_clearing" , ! res . getBoolean ( "skip_clearing" ) ) ;
}
}
if ( "4" . equals ( clientWithConfig . getString ( "source" ) ) ) {
return res ;
res . put ( "refuse_remark" , clientWithConfig . getString ( "refuse_remark" ) ) ;
res . put ( "base_info_lack" , false ) ;
res . put ( "compliance_info_lack" , false ) ;
if ( StringUtils . isEmpty ( clientWithConfig . getString ( "business_structure" ) ) | | StringUtils . isEmpty ( clientWithConfig . getString ( "logo_url" ) )
| | StringUtils . isEmpty ( clientWithConfig . getString ( "description" ) )
| | ( "Company" . equals ( clientWithConfig . getString ( "business_structure" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "acn" ) ) )
| | ( ! "Company" . equals ( clientWithConfig . getString ( "business_structure" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "abn" ) ) )
| | ( StringUtils . isEmpty ( clientWithConfig . getString ( "company_website" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "company_photo" ) )
& & StringUtils . isEmpty ( clientWithConfig . getString ( "store_photo" ) ) ) ) {
res . put ( "base_info_lack" , true ) ;
}
JSONObject file = clientManager . getAuthFiles ( null , clientWithConfig . getString ( "client_moniker" ) ) ;
for ( String s : fileName ) {
if ( file . getString ( s ) = = null ) {
res . put ( "compliance_info_lack" , true ) ;
}
}
@Override
public JSONObject getClientInfoByMoniker ( JSONObject device , String clientMoniker ) {
String clientType = device . getString ( "client_type" ) ;
deviceSupport . findRegister ( clientType ) ;
if ( ! isSubPartner ( device , clientMoniker ) ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
}
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
client . putAll ( clientConfigService . find ( client . getIntValue ( "client_id" ) ) ) ;
JSONObject res = getClientBaseInfo ( client ) ;
if ( clientType . equals ( "iphone" ) ) {
res . put ( "skip_clearing" , ! res . getBoolean ( "skip_clearing" ) ) ;
}
}
return res ;
return res ;
}
}
@ -637,6 +712,22 @@ public class RetailAppServiceImp implements RetailAppService {
return clientWithConfig ;
return clientWithConfig ;
}
}
@Override
public JSONObject getQRCodePaySurChargeByMoniker ( JSONObject device , String clientMoniker ) {
if ( ! isSubPartner ( device , clientMoniker ) ) {
throw new ForbiddenException ( "You have no permission" ) ;
}
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
client . putAll ( clientConfigService . find ( client . getIntValue ( "client_id" ) ) ) ;
JSONObject result = new JSONObject ( ) ;
result . put ( "qrcode_surcharge" , client . getBooleanValue ( "qrcode_surcharge" ) ) ;
result . put ( "retail_surcharge" , client . getBooleanValue ( "retail_surcharge" ) ) ;
result . put ( "api_surcharge" , client . getBooleanValue ( "api_surcharge" ) ) ;
result . put ( "require_custinfo" , client . getBooleanValue ( "require_custinfo" ) ) ;
result . put ( "require_remark" , client . getBooleanValue ( "require_remark" ) ) ;
return result ;
}
@Override
@Override
public JSONObject getClientInfoMe ( JSONObject device ) {
public JSONObject getClientInfoMe ( JSONObject device ) {
JSONObject result = new JSONObject ( ) ;
JSONObject result = new JSONObject ( ) ;
@ -1490,50 +1581,21 @@ public class RetailAppServiceImp implements RetailAppService {
String clientType = device . getString ( "client_type" ) ;
String clientType = device . getString ( "client_type" ) ;
deviceSupport . findRegister ( clientType ) ;
deviceSupport . findRegister ( clientType ) ;
int clientId = device . getIntValue ( "client_id" ) ;
int clientId = device . getIntValue ( "client_id" ) ;
Date now = new Date ( ) ;
return getClientRateByClientId ( clientId ) ;
JSONObject res = merchantInfoProvider . clientCurrentRate ( clientId , now , "Wechat" ) ;
JSONObject client = clientManager . getClientInfo ( clientId ) ;
Assert . notNull ( client , "Client is null" ) ;
JSONObject clientConfig = clientConfigService . find ( clientId ) ;
ArrayList < JSONObject > channels = new ArrayList < > ( ) ;
if ( clientConfig . getBigDecimal ( "customer_surcharge_rate" ) ! = null ) {
res . put ( "customer_surcharge_rate" , clientConfig . getBigDecimal ( "customer_surcharge_rate" ) ) ;
}
}
res . put ( "max_customer_surcharge_rate" , PlatformEnvironment . getEnv ( ) . getMaxCustomerSurchargeRate ( ) ) ;
JSONObject wechat = getChannel ( clientId , now , "Wechat" ) ;
@Override
if ( wechat . containsKey ( "channel" ) ) {
public JSONObject getClientCurrentRateNewByMoniker ( JSONObject device , String clientMoniker ) {
channels . add ( wechat ) ;
String clientType = device . getString ( "client_type" ) ;
}
deviceSupport . findRegister ( clientType ) ;
JSONObject alipay = getChannel ( clientId , now , "Alipay" ) ;
if ( ! isSubPartner ( device , clientMoniker ) ) {
if ( alipay . containsKey ( "channel" ) ) {
throw new ForbiddenException ( "You have no permission" ) ;
channels . add ( alipay ) ;
}
JSONObject bestpay = getChannel ( clientId , now , "Bestpay" ) ;
if ( bestpay . containsKey ( "channel" ) ) {
channels . add ( bestpay ) ;
}
JSONObject jd = getChannel ( clientId , now , "jd" ) ;
if ( jd . containsKey ( "channel" ) ) {
channels . add ( jd ) ;
}
}
JSONObject AlipayOnline = getChannel ( clientId , now , "AlipayOnline" ) ;
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
if ( AlipayOnline. containsKey ( "channel" ) ) {
if ( client = = null ) {
channels . add ( AlipayOnline ) ;
throw new NotFoundException ( "Client not found, please check" ) ;
}
}
// JSONObject Hf = getChannel(clientId, now, "hf");
return getClientRateByClientId ( client . getIntValue ( "client_id" ) ) ;
// if (Hf.containsKey("channel")) {
// channels.add(Hf);
// }
// JSONObject Yeepay = getChannel(clientId, now, "Yeepay");
// if (Yeepay.containsKey("channel")) {
// channels.add(Yeepay);
// }
JSONObject CBBankPay = getChannel ( clientId , now , "CB_BankPay" ) ;
if ( CBBankPay . containsKey ( "channel" ) ) {
channels . add ( CBBankPay ) ;
}
res . put ( "channels" , channels ) ;
return res ;
}
}
private JSONObject getChannel ( int clientId , Date date , String channel ) {
private JSONObject getChannel ( int clientId , Date date , String channel ) {
@ -2250,12 +2312,11 @@ public class RetailAppServiceImp implements RetailAppService {
deviceSupport . findRegister ( clientType ) ;
deviceSupport . findRegister ( clientType ) ;
JSONObject client = clientMapper . findClient ( device . getIntValue ( "client_id" ) ) ;
JSONObject client = clientMapper . findClient ( device . getIntValue ( "client_id" ) ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
JSONObject account = clientAccountMapper . findById ( device . getString ( "account_id" ) ) ;
JSONObject authFileStatus = signInAccountService . checkAuthFileStatus ( client ) ;
if ( PartnerRole . getRole ( account . getIntValue ( "role" ) ) = = PartnerRole . CASHIER ) {
if ( PartnerRole . getRole ( account . getIntValue ( "role" ) ) = = PartnerRole . CASHIER ) {
JSONObject cashierResult = new JSONObject ( ) ;
authFileStatus . put ( "client_less_file" , false ) ;
cashierResult . put ( "client_less_file" , false ) ;
return cashierResult ;
}
}
return signInAccountService. checkAuthFileStatus ( client ) ;
return authFileStatus ;
}
}
@Override
@Override
@ -2387,6 +2448,19 @@ public class RetailAppServiceImp implements RetailAppService {
clientManager . commitAuthFilesToCompliance ( client . getString ( "client_moniker" ) , account , "App" ) ;
clientManager . commitAuthFilesToCompliance ( client . getString ( "client_moniker" ) , account , "App" ) ;
}
}
@Override
public boolean isSubPartner ( JSONObject device , String clientMoniker ) {
JSONObject client = clientManager . getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new NotFoundException ( "Client not found, please check" ) ;
}
if ( device . getIntValue ( "client_id" ) = = client . getIntValue ( "client_id" ) ) {
return true ;
}
JSONObject deviceClient = clientManager . getClientInfo ( device . getIntValue ( "client_id" ) ) ;
JSONArray listSubClients = clientManager . getAllClientIds ( device . getIntValue ( "client_id" ) ) ;
return ( listSubClients . contains ( client . getString ( "client_id" ) ) & & deviceClient . getBooleanValue ( "sub_manage" ) ) ;
}
private void exportCBBankAggregateFile ( JSONObject client , HttpServletResponse httpResponse ) {
private void exportCBBankAggregateFile ( JSONObject client , HttpServletResponse httpResponse ) {
httpResponse . setContentType ( "application/pdf" ) ;
httpResponse . setContentType ( "application/pdf" ) ;
@ -2444,4 +2518,84 @@ public class RetailAppServiceImp implements RetailAppService {
List < JSONObject > list = clientBankAccountMapper . clientBankAccounts ( client_id ) ;
List < JSONObject > list = clientBankAccountMapper . clientBankAccounts ( client_id ) ;
return list . isEmpty ( ) ? new JSONObject ( ) : list . get ( 0 ) ;
return list . isEmpty ( ) ? new JSONObject ( ) : list . get ( 0 ) ;
}
}
private JSONObject getClientBaseInfo ( JSONObject clientWithConfig ) {
JSONObject res = SignInAccountServiceImpl . clientInfoWithNoSecretInfo ( clientWithConfig ) ;
res . put ( "is_skip_clearing" , res . getBoolean ( "skip_clearing" ) ) ;
if ( "4" . equals ( clientWithConfig . getString ( "source" ) ) ) {
res . put ( "refuse_remark" , clientWithConfig . getString ( "refuse_remark" ) ) ;
res . put ( "base_info_lack" , false ) ;
res . put ( "compliance_info_lack" , false ) ;
if ( StringUtils . isEmpty ( clientWithConfig . getString ( "business_structure" ) ) | | StringUtils . isEmpty ( clientWithConfig . getString ( "logo_url" ) )
| | StringUtils . isEmpty ( clientWithConfig . getString ( "description" ) )
| | ( "Company" . equals ( clientWithConfig . getString ( "business_structure" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "acn" ) ) )
| | ( ! "Company" . equals ( clientWithConfig . getString ( "business_structure" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "abn" ) ) )
| | ( StringUtils . isEmpty ( clientWithConfig . getString ( "company_website" ) ) & & StringUtils . isEmpty ( clientWithConfig . getString ( "company_photo" ) )
& & StringUtils . isEmpty ( clientWithConfig . getString ( "store_photo" ) ) ) ) {
res . put ( "base_info_lack" , true ) ;
}
JSONObject file = clientManager . getAuthFiles ( null , clientWithConfig . getString ( "client_moniker" ) ) ;
for ( String s : fileName ) {
if ( file . getString ( s ) = = null ) {
res . put ( "compliance_info_lack" , true ) ;
}
}
}
JSONObject clientLegal = sysClientLegalPersonMapper . findRepresentativeInfo ( res . getIntValue ( "client_id" ) ) ;
if ( clientLegal ! = null ) {
res . put ( "legal_person" , clientLegal . getString ( "representative_person" ) ) ;
res . put ( "legal_job_title" , clientLegal . getString ( "job_title" ) ) ;
res . put ( "legal_phone" , clientLegal . getString ( "phone" ) ) ;
res . put ( "legal_email" , clientLegal . getString ( "email" ) ) ;
}
return res ;
}
private JSONObject getClientRateByClientId ( int clientId ) {
Date now = new Date ( ) ;
JSONObject res = merchantInfoProvider . clientCurrentRate ( clientId , now , "Wechat" ) ;
JSONObject client = clientManager . getClientInfo ( clientId ) ;
Assert . notNull ( client , "Client is null" ) ;
JSONObject clientConfig = clientConfigService . find ( clientId ) ;
ArrayList < JSONObject > channels = new ArrayList < > ( ) ;
if ( clientConfig . getBigDecimal ( "customer_surcharge_rate" ) ! = null ) {
res . put ( "customer_surcharge_rate" , clientConfig . getBigDecimal ( "customer_surcharge_rate" ) ) ;
}
res . put ( "max_customer_surcharge_rate" , PlatformEnvironment . getEnv ( ) . getMaxCustomerSurchargeRate ( ) ) ;
JSONObject wechat = getChannel ( clientId , now , "Wechat" ) ;
if ( wechat . containsKey ( "channel" ) ) {
channels . add ( wechat ) ;
}
JSONObject alipay = getChannel ( clientId , now , "Alipay" ) ;
if ( alipay . containsKey ( "channel" ) ) {
channels . add ( alipay ) ;
}
JSONObject bestpay = getChannel ( clientId , now , "Bestpay" ) ;
if ( bestpay . containsKey ( "channel" ) ) {
channels . add ( bestpay ) ;
}
JSONObject jd = getChannel ( clientId , now , "jd" ) ;
if ( jd . containsKey ( "channel" ) ) {
channels . add ( jd ) ;
}
JSONObject AlipayOnline = getChannel ( clientId , now , "AlipayOnline" ) ;
if ( AlipayOnline . containsKey ( "channel" ) ) {
channels . add ( AlipayOnline ) ;
}
// JSONObject Hf = getChannel(clientId, now, "hf");
// if (Hf.containsKey("channel")) {
// channels.add(Hf);
// }
// JSONObject Yeepay = getChannel(clientId, now, "Yeepay");
// if (Yeepay.containsKey("channel")) {
// channels.add(Yeepay);
// }
JSONObject CBBankPay = getChannel ( clientId , now , "CB_BankPay" ) ;
if ( CBBankPay . containsKey ( "channel" ) ) {
channels . add ( CBBankPay ) ;
}
res . put ( "channels" , channels ) ;
return res ;
}
}
}