hotfix: copy mw config

master
Yixian 3 years ago
parent 0e536c0d02
commit 06aa10563a

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.channels.rpaypaymentsvc.mappers.RPayMerchantMapper;
import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.request.entities.RPayMerchantEntity;
import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.SysClientUpayProfileMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
@ -30,6 +31,8 @@ public class MerchantChannelPermissionServiceImpl implements MerchantChannelPerm
private RPayMerchantMapper rPayMerchantMapper;
@Resource
private ClientRateMapper clientRateMapper;
@Resource
private PaymentApi paymentApi;
@Override
@Transactional
@ -66,8 +69,10 @@ public class MerchantChannelPermissionServiceImpl implements MerchantChannelPerm
targetRPayMch.setClientMoniker(targetMerchant.getString("client_moniker"));
rPayMerchantMapper.save(targetRPayMch);
}
clientManager.switchPermission(manager, targetClientMoniker, "enable_rpaypmt_card", sourceMerchant.getBooleanValue("enable_rpaypmt_card"));
clientManager.switchPermission(manager, targetClientMoniker, "enable_rpaypmt_dd", sourceMerchant.getBooleanValue("enable_rpaypmt_dd"));
boolean enableCard = paymentApi.channelApi(PayChannel.RPAY_CHANNEL_CARD.getChannelCode()).getChannelPermissionResolver().channelEnabled(sourceMerchant);
boolean enableDd = paymentApi.channelApi(PayChannel.RPAY_CHANNEL_DD.getChannelCode()).getChannelPermissionResolver().channelEnabled(sourceMerchant);
clientManager.switchChannelPermission(manager, targetClientMoniker, PayChannel.RPAY_CHANNEL_CARD.getChannelCode(), enableCard);
clientManager.switchChannelPermission(manager, targetClientMoniker, PayChannel.RPAY_CHANNEL_DD.getChannelCode(), enableDd);
try {
merchantInfoProvider.clientCurrentRate(targetClientId, new Date(), PayChannel.RPAY_CHANNEL_CARD.getChannelCode());
} catch (NoRateConfigException e) {

Loading…
Cancel
Save