|
|
|
@ -27,7 +27,10 @@ import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
|
|
|
|
|
import au.com.royalpay.payment.manage.system.core.TradeSecureService;
|
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
|
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
|
import au.com.royalpay.payment.tools.defines.TradeType;
|
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
|
|
import au.com.royalpay.payment.tools.env.SysConfigManager;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
@ -125,6 +128,8 @@ public class TestController implements ApplicationEventPublisherAware {
|
|
|
|
|
@Resource
|
|
|
|
|
private SysConfigManager sysConfigManager;
|
|
|
|
|
@Resource
|
|
|
|
|
private MpWechatApiProvider mpWechatApiProvider;
|
|
|
|
|
@Resource
|
|
|
|
|
private TradeSecureService tradeSecureService;
|
|
|
|
|
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
|
|
|
|
|
|
|
|
|
@ -466,4 +471,33 @@ public class TestController implements ApplicationEventPublisherAware {
|
|
|
|
|
public void initClientPayType(@RequestParam int begin,@RequestParam int end) {
|
|
|
|
|
aliforexcelService.initClientPayType(begin,end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/open/cb_bankpay")
|
|
|
|
|
public void switchCBBankPayLinkPermission() {
|
|
|
|
|
List<JSONObject> merchants = clientMapper.listNeedOpenCbpayMerchant();
|
|
|
|
|
merchants.forEach(mch -> {
|
|
|
|
|
JSONObject client = clientMapper.findClientByMonikerAll(mch.getString("client_moniker"));
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(client.getString("cb_bankpay_url"))) {
|
|
|
|
|
String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link/pc");
|
|
|
|
|
String cb_bankpay_url = getCBBankShortLink(longUrl);
|
|
|
|
|
client.put("cb_bankpay_url", cb_bankpay_url);
|
|
|
|
|
client.put("enable_cb_bankpay_link", true);
|
|
|
|
|
client.put("enable_cb_bankpay", true);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
} else {
|
|
|
|
|
client.put("enable_cb_bankpay_link", true);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getCBBankShortLink(String longUrl) {
|
|
|
|
|
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
|
|
|
|
|
return api.registerShortUrl(longUrl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|