支付宝aps海外钱包 开关

master
dalong306 4 years ago
parent f906e0e46e
commit ef9d71c19b

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.3.5</version> <version>2.3.6</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>

@ -322,6 +322,8 @@ public interface ClientManager {
void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund); void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund);
void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet);
void changeGatewayVersion(JSONObject account, boolean enableV2); void changeGatewayVersion(JSONObject account, boolean enableV2);
void changeVerifyIp(JSONObject account, boolean enableV2); void changeVerifyIp(JSONObject account, boolean enableV2);

@ -32,9 +32,7 @@ import au.com.royalpay.payment.core.beans.MerchantApplicationResult;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager; import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
import au.com.royalpay.payment.core.mappers.MchChannelContractDAO; import au.com.royalpay.payment.core.mappers.*;
import au.com.royalpay.payment.core.mappers.MchChannelContractMapper;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
@ -338,6 +336,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource @Resource
private MchChannelContractMapper mchChannelContractMapper; private MchChannelContractMapper mchChannelContractMapper;
@Resource
public AlipayApsOverseasConfigMapper overseaSwitchConfigMapper;
@Resource @Resource
private SmsSender smsSender; private SmsSender smsSender;
private static final String SOURCE_AGREE_FILE = "source_agree_file"; private static final String SOURCE_AGREE_FILE = "source_agree_file";
@ -602,6 +603,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("aps_config_id", apsConfig.getId()); client.put("aps_config_id", apsConfig.getId());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch()); client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
} }
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getInteger("client_id"));
if(overseaSwitch==null||overseaSwitch){
client.put("oversea_wallet_switch", true);
}else{
client.put("oversea_wallet_switch", false);
}
return client; return client;
} }
@ -4973,6 +4980,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id")); clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
} }
/**
* aps
* @param manager
* @param clientMoniker
* @param enableOverseaWallet
*/
@Override
public void switchOverseaWallet(JSONObject manager, String clientMoniker, boolean enableOverseaWallet) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
Boolean overseaSwitch= overseaSwitchConfigMapper.getOverseaSwitch(client.getIntValue("client_id"));
logger.info("======>overseaSwitch:{}",overseaSwitch);
if(overseaSwitch==null){
ApsOverseasConfigData data = ApsOverseasConfigData.saveData(manager.getString("manager_id"),client.getString("client_id"),enableOverseaWallet);
logger.info("=======>data:OverseasSwitch:{}",data.getOverseasSwitch());
overseaSwitchConfigMapper.save(data);
}else{
JSONObject config=new JSONObject();
config.put("clientId", client.getString("client_id"));
config.put("modifier", manager.getString("manager_id"));
config.put("overseas_switch", enableOverseaWallet);
overseaSwitchConfigMapper.updateApsOverseasConfigByClientId(config);
}
}
@Override @Override
public void changePaymentPage(JSONObject account, String paypadVersion) { public void changePaymentPage(JSONObject account, String paypadVersion) {
int clientId = account.getIntValue("client_id"); int clientId = account.getIntValue("client_id");

@ -343,6 +343,10 @@ public class PartnerManageController {
public void switchChildEachRefund(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchChildEachRefund(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchChildEachRefund(manager, clientMoniker, pass.getBooleanValue("allow")); clientManager.switchChildEachRefund(manager, clientMoniker, pass.getBooleanValue("allow"));
} }
@ManagerMapping(value = "/{clientMoniker}/switch_oversea_wallet", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR})
public void switchOverseaWallet(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.switchOverseaWallet(manager, clientMoniker, pass.getBooleanValue("allow"));
}
@ManagerMapping(value = "/{clientMoniker}/channels/{channel}/permission", method = RequestMethod.PUT, role = {ManagerRole.SERVANT, ManagerRole.DEVELOPER}) @ManagerMapping(value = "/{clientMoniker}/channels/{channel}/permission", method = RequestMethod.PUT, role = {ManagerRole.SERVANT, ManagerRole.DEVELOPER})
public void switchChannelPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { public void switchChannelPermission(@PathVariable String clientMoniker, @PathVariable String channel, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {

@ -2810,6 +2810,21 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
} }
) )
} }
$scope.toggleOverseaWallet = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/switch_oversea_wallet', {allow: $scope.paymentInfo.oversea_wallet_switch}).then(
function () {
$scope.loadPartnerPaymentInfo()
},
function (resp) {
commonDialog.alert({
title: 'failed to switch oversea wallet',
content: resp.data.message,
type: 'error',
})
}
)
}
$scope.switchInternationalCard = function () { $scope.switchInternationalCard = function () {
if (!$scope.paymentInfo) { if (!$scope.paymentInfo) {

@ -570,6 +570,21 @@
</div> </div>
</div> </div>
<!--Alipayplus(aps)是否支持海外钱包-->
<div class="panel panel-default" ng-if="(('111'|withRole)) && paymentInfo.aps_config_id">
<div class="panel-heading">AlipayPlus(aps) oversea wallet Configuration</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Enable oversea wallet</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.oversea_wallet_switch" bs-switch
switch-change="toggleOverseaWallet()">
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-if="('111'|withRole) || ('retail_surcharge'|withFunc)"> <div class="panel panel-default" ng-if="('111'|withRole) || ('retail_surcharge'|withFunc)">
<div class="panel-heading">Retail In Store Payment(App, WePayLite, Albert)</div> <div class="panel-heading">Retail In Store Payment(App, WePayLite, Albert)</div>
<div class="panel-body"> <div class="panel-body">

Loading…
Cancel
Save