Merge remote-tracking branch 'origin/alipayplus_aps' into alipayplus_aps

master
dalong306 3 years ago
commit 036ebe62cf

@ -553,6 +553,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) { resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) {
client.put("enable_alipayplus", true); client.put("enable_alipayplus", true);
} }
client.put("enable_alipayaps", false);
MerchantChannelPermissionResolver resolverAps = this.paymentApi.channelApi(PayChannel.ALIPAY_APS.getChannelCode()).getChannelPermissionResolver();
if (!Objects.isNull(resolver) &&
resolverAps.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) {
client.put("enable_alipayaps", true);
}
ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id")); ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id"));
if (apsConfig == null) { if (apsConfig == null) {
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor()); apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor());
@ -1588,9 +1594,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new NotFoundException("Client Not Exists"); throw new NotFoundException("Client Not Exists");
} }
try { try {
clientModifySupport.processModify(new SwitchChannelPermissionModify(manager, clientMoniker, merchantInfoProvider, paymentApi.channelApi(channel).getChannelPermissionResolver(), allow)); clientModifySupport.processModify(new SwitchChannelPermissionModify(manager, clientMoniker, merchantInfoProvider, channelApi.getChannelPermissionResolver(), allow));
} catch (Exception e) { } catch (Exception e) {
logger.error("Failed to change channel switch:{}", channel); logger.error("Failed to change channel switch:{}", channel,e);
} }
logger.info("{}({}) switched client {} channel {} to {}", manager.getString("display_name"), manager.getString("manager_id"), clientMoniker, channel, allow); logger.info("{}({}) switched client {} channel {} to {}", manager.getString("display_name"), manager.getString("manager_id"), clientMoniker, channel, allow);
if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) { if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) {

@ -258,14 +258,14 @@ $(function () {
data.qrcodeVersion = window.qrcodeVersion; data.qrcodeVersion = window.qrcodeVersion;
$.ajax({ $.ajax({
url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders', url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders',
method: 'POST', method: 'POST',
data: JSON.stringify(data), data: JSON.stringify(data),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
success: function (pay) { success: function (pay) {
if (pay.direct_paid) { if (pay.direct_paid) {
location.href = '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return; return;
} }
if (pay.mweb_url){ if (pay.mweb_url){
@ -294,7 +294,7 @@ $(function () {
}, },
closeCurrentApp: false closeCurrentApp: false
}); });
startCheckOrder(pay.order_id, '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); startCheckOrder(pay.order_id, '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result');
} else if (res.resultCode == '6001') { } else if (res.resultCode == '6001') {
//do nothing //do nothing
} else { } else {

@ -303,14 +303,14 @@ $(function () {
data.coupons = dataCache.coupons; data.coupons = dataCache.coupons;
data.qrcodeVersion = window.qrcodeVersion; data.qrcodeVersion = window.qrcodeVersion;
$.ajax({ $.ajax({
url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders', url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders',
method: 'POST', method: 'POST',
data: JSON.stringify(data), data: JSON.stringify(data),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
success: function (pay) { success: function (pay) {
if (pay.direct_paid) { if (pay.direct_paid) {
location.href = '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return; return;
} }
if (pay.mweb_url){ if (pay.mweb_url){
@ -339,7 +339,7 @@ $(function () {
}, },
closeCurrentApp: false closeCurrentApp: false
}); });
startCheckOrder(pay.order_id, '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); startCheckOrder(pay.order_id, '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result');
} else if (res.resultCode == '6001') { } else if (res.resultCode == '6001') {
//do nothing //do nothing
} else { } else {

@ -266,14 +266,14 @@ $(function () {
data.coupons = dataCache.coupons; data.coupons = dataCache.coupons;
data.qrcodeVersion = window.qrcodeVersion; data.qrcodeVersion = window.qrcodeVersion;
$.ajax({ $.ajax({
url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders', url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders',
method: 'POST', method: 'POST',
data: JSON.stringify(data), data: JSON.stringify(data),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json', dataType: 'json',
success: function (pay) { success: function (pay) {
if (pay.direct_paid) { if (pay.direct_paid) {
location.href = '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; location.href = '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result';
return; return;
} }
if (pay.mweb_url){ if (pay.mweb_url){
@ -302,7 +302,7 @@ $(function () {
}, },
closeCurrentApp: false closeCurrentApp: false
}); });
startCheckOrder(pay.order_id, '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); startCheckOrder(pay.order_id, '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result');
} else if (res.resultCode == '6001') { } else if (res.resultCode == '6001') {
//do nothing //do nothing
} else { } else {

Loading…
Cancel
Save