add copy upay profile api

master
yixian 4 years ago
parent dabc492fa9
commit bd82a9f3c4

@ -9,6 +9,7 @@ import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.MerchantChannelPermissionService;
import au.com.royalpay.payment.tools.defines.PayChannel;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
@ -34,7 +35,13 @@ public class MerchantChannelPermissionServiceImpl implements MerchantChannelPerm
@Transactional
public RPayMerchantEntity copyMerchantWarriorConfig(JSONObject manager, String targetClientMoniker, String sourceClientMoniker) {
JSONObject targetMerchant = merchantInfoProvider.getClientInfoByMoniker(targetClientMoniker);
if (targetMerchant == null) {
throw new NotFoundException("Merchant not found:" + targetClientMoniker);
}
JSONObject sourceMerchant = merchantInfoProvider.getClientInfoByMoniker(sourceClientMoniker);
if (sourceMerchant == null) {
throw new NotFoundException("Merchant not found:" + sourceClientMoniker);
}
int sourceClientId = sourceMerchant.getIntValue("client_id");
int targetClientId = targetMerchant.getIntValue("client_id");
JSONObject targetProfile = sysClientUpayProfileMapper.findInfo(targetClientId);

Loading…
Cancel
Save