|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.merchants.core.impls;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.config.AlipayConfig;
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
|
|
|
|
|
import au.com.royalpay.payment.channels.rpay.runtime.RpayApi;
|
|
|
|
|
import au.com.royalpay.payment.channels.rpay.runtime.beans.SubRpayMerchantInfo;
|
|
|
|
|
import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig;
|
|
|
|
@ -12,6 +15,7 @@ import au.com.royalpay.payment.channels.yeepay.runtime.YeePayClient;
|
|
|
|
|
import au.com.royalpay.payment.core.PaymentChannelApi;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.EmailException;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
|
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
|
|
|
|
|
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
|
|
|
|
@ -144,6 +148,7 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.security.InvalidParameterException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
@ -225,6 +230,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
private SignInAccountService signInAccountService;
|
|
|
|
|
@Resource
|
|
|
|
|
private WxPayClient wxPayClient;
|
|
|
|
|
@Resource
|
|
|
|
|
private AlipayClient alipayClient;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private RpayApi rpayApi;
|
|
|
|
@ -3664,6 +3671,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
return sub_merchant_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void registerAlipayGms(String clientMoniker, JSONObject manager) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) {
|
|
|
|
|
throw new InvalidParameterException("store photo cannot be empty ");
|
|
|
|
|
}
|
|
|
|
|
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
|
|
|
|
|
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
|
|
|
|
|
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
|
|
|
|
|
throw new BadRequestException(resultElement.elementText("error"));
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
Element responseElement = resultElement.element("response").element("alipay");
|
|
|
|
|
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
|
|
|
|
|
throw new BadRequestException(responseElement.elementText("result_code"));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ServerErrorException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|