add v2 gateway商户配置

master
luoyang 6 years ago
parent c6e00a74db
commit 8e12b4b7e5

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.29</docker-image.version>
<docker-image.version>1.0.30</docker-image.version>
</properties>
<dependencies>

@ -0,0 +1,21 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator;
@AutoMapper(tablename = "merchant_sign_info", pkName = "client_id", keyGenerator = Jdbc3KeyGenerator.class)
public interface MerchantSignInfoMapper {
@AutoSql(type = SqlType.SELECT)
JSONObject findClientSign(@Param("client_id") int clientId);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject signInfo);
@AutoSql(type = SqlType.INSERT)
void insert(JSONObject signInfo);
}

@ -245,6 +245,10 @@ public interface ClientManager {
void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund);
void changeGatewayVersion(JSONObject account, boolean enable_v2);
void changeVerifyIp(JSONObject account, boolean enable_v2);
void changePaymentPage(JSONObject account, String paypad_version);
void changeManualSettle(JSONObject account , int client_id, boolean manual_settle,String operator_id,int type,String operation);
@ -291,6 +295,12 @@ public interface ClientManager {
void setCustomerSurchargeRate(JSONObject account,String clientMoniker, BigDecimal customer_surcharge_rate);
void setPartnerPublicKeyConfig(JSONObject account, String ipWhitelistConfig);
void refreshPlatformPublicKeyConfig(JSONObject account);
void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig);
void setOrderExpiryConfig(JSONObject account,String clientMoniker, String orderExpiryConfig);
void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception;

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
/**
@ -11,4 +12,6 @@ public interface ClientModifySupport {
void processClientModify(ClientModify clientModify);
void processClientConfigModify(ClientConfigModify clientConfigModify);
void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify);
}

@ -42,6 +42,7 @@ import au.com.royalpay.payment.manage.support.sms.SmsSender;
import au.com.royalpay.payment.manage.system.core.ClientContractService;
import au.com.royalpay.payment.manage.system.core.MailGunService;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.codec.RSACrypt;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
@ -101,6 +102,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMethod;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import sun.misc.BASE64Encoder;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@ -117,10 +119,9 @@ import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.util.List;
import java.util.*;
import java.util.concurrent.TimeUnit;
@ -274,6 +275,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private SysClientMapper sysClientMapper;
@Resource
private MerchantSignInfoMapper merchantSignInfoMapper;
@Resource
private Locker locker;
@ -421,6 +424,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
&& sysClientMapper.childClientId(client.getIntValue("client_id")).size() > 0) {
client.put("level2_client", 1);
}
//gateway V2
JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getIntValue("client_id"));
if (partnerGatewaySign == null) {
client.put("enable_gateway_version2", false);
}else {
client.put("enable_gateway_version2", partnerGatewaySign.getBooleanValue("is_valid"));
client.put("gateway_sign", partnerGatewaySign);
}
return client;
}
@ -3212,6 +3224,79 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager, clientMoniker, paypad_version));
}
@Override
public void changeGatewayVersion(JSONObject account, boolean enable_gateway_v2) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject gatewaySignInfo = merchantSignInfoMapper.findClientSign(account.getIntValue("client_id"));
if (gatewaySignInfo == null) {
JSONObject key = getRsaKey();
gatewaySignInfo = new JSONObject();
gatewaySignInfo.put("client_id", account.getIntValue("client_id"));
gatewaySignInfo.put("platform_public_key", key.getString("public_key"));
gatewaySignInfo.put("platform_private_key", key.getString("private_key"));
gatewaySignInfo.put("is_valid", 0);
gatewaySignInfo.put("creation_by", account.getString("account_id"));
gatewaySignInfo.put("creation_date", new Date());
gatewaySignInfo.put("last_update_by", account.getString("account_id"));
gatewaySignInfo.put("last_update_date", new Date());
merchantSignInfoMapper.insert(gatewaySignInfo);
}
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"is_valid" ,enable_gateway_v2));
}
@Override
public void changeVerifyIp(JSONObject account, boolean verify_ip) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"verify_ip" ,verify_ip));
}
@Override
public void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
if (StringUtils.isNotBlank(ipWhitelistConfig)) {
clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"ip_whitelist", ipWhitelistConfig, "重新设置IP白名单"));
}
}
@Override
@Transactional
public void refreshPlatformPublicKeyConfig(JSONObject account) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject key = getRsaKey();
clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_public_key",key.getString("public_key"),"重新生成平台公钥"));
clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_private_key",key.getString("private_key"),"重新生成平台私钥"));
}
@Override
public void setPartnerPublicKeyConfig(JSONObject account, String publicKey) {
int clientId = account.getIntValue("client_id");
JSONObject client = getClientInfo(clientId);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject update = new JSONObject();
update.put("client_id", client.getIntValue("client_id"));
if (StringUtils.isNotBlank(publicKey)) {
clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "mch_public_key", publicKey, "重新设置商户公钥"));
}
}
@Override
public void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccess_version) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
@ -5029,4 +5114,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return null;
}
private JSONObject getRsaKey() {
JSONObject key = new JSONObject();
KeyPair keyPairGen = RSACrypt.generateKeyPairs();
RSAPublicKey publicKey = (RSAPublicKey) keyPairGen.getPublic();
RSAPrivateKey privateKey = (RSAPrivateKey) keyPairGen.getPrivate();
key.put("public_key", new BASE64Encoder().encode(publicKey.getEncoded()));
key.put("private_key", new BASE64Encoder().encode(privateKey.getEncoded()));
return key;
}
}

@ -2,9 +2,11 @@ package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import au.com.royalpay.payment.manage.merchants.entity.ClientModify;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
@ -21,6 +23,8 @@ public class ClientModifySupportImpl implements ClientModifySupport {
@Resource
private MerchantInfoProvider merchantInfoProvider;
@Resource
private MerchantSignInfoMapper merchantSignInfoMapper;
@Resource
private ClientInfoCacheSupport clientInfoCacheSupport;
@Resource
private ClientMapper clientMapper;
@ -40,4 +44,10 @@ public class ClientModifySupportImpl implements ClientModifySupport {
int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId);
}
@Override
public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) {
int clientId =clientGatewaySignModify.doModify(merchantInfoProvider, merchantSignInfoMapper,mongoTemplate);
clientInfoCacheSupport.clearClientCache(clientId);
}
}

@ -0,0 +1,78 @@
package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper;
import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.id.IdUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Create by yixian at 2018-04-12 16:19
*/
public abstract class ClientGatewaySignModify {
private JSONObject account;
private String clientMoniker;
public ClientGatewaySignModify(JSONObject account, String clientMoniker) {
this.account = account;
this.clientMoniker = clientMoniker;
}
protected abstract String business();
protected abstract JSONObject getModifyResult();
@Transactional
public int doModify(MerchantInfoProvider merchantInfoProvider, MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) {
JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker);
JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(client.getIntValue("client_id"));
JSONObject modifyResult = getModifyResult();
try {
saveModifyHistory(clientGatewaySign, modifyResult, mongoTemplate);
}catch (Exception e){
}
int clientId = client.getIntValue("client_id");
modifyResult.put("client_id", clientId);
modifyResult.put("last_update_by", account.getString("account_id"));
modifyResult.put("last_update_date", new Date());
merchantSignInfoMapper.update(modifyResult);
return clientId;
}
private void saveModifyHistory(JSONObject clientGatewaySign, JSONObject modifyResult, MongoTemplate mongoTemplate) {
if (account == null) {
return;
}
ClientConfigLog clientConfigLog = new ClientConfigLog();
clientConfigLog.setId(IdUtil.getId());
clientConfigLog.setBusiness(business());
clientConfigLog.setClientId(clientGatewaySign.getIntValue("client_id"));
boolean isPartner = true;
if (StringUtils.isNotEmpty(account.getString("account_id"))) {
isPartner = true;
}
if (StringUtils.isNotEmpty(account.getString("manager_id"))) {
isPartner = false;
}
clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager");
clientConfigLog.setCreateTime(new Date());
clientConfigLog.setNewData(modifyResult.toJSONString());
clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id"));
Map<String, Object> beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, clientGatewaySign::get));
clientConfigLog.setOriginData(JSON.toJSONString(beforeModify));
clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name"));
mongoTemplate.save(clientConfigLog);
}
}

@ -0,0 +1,33 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class GatewayInfoModify extends ClientGatewaySignModify {
private String key;
private String value;
private String changeMess;
public GatewayInfoModify(JSONObject account, String clientMoniker, String key, String value, String changeMess) {
super(account, clientMoniker);
this.key = key;
this.value = value;
this.changeMess = changeMess;
}
@Override
protected String business() {
return changeMess;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put(key, value);
return modify;
}
}

@ -0,0 +1,31 @@
package au.com.royalpay.payment.manage.merchants.entity.impls;
import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify;
import com.alibaba.fastjson.JSONObject;
/**
* Create by yixian at 2018-04-12 16:43
*/
public class SwitchGatewaySignPermissionModify extends ClientGatewaySignModify {
private String key;
private boolean value;
public SwitchGatewaySignPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) {
super(account, clientMoniker);
this.key = key;
this.value = value;
}
@Override
protected String business() {
return (value?"开启 ":"关闭 ")+key;
}
@Override
protected JSONObject getModifyResult() {
JSONObject modify = new JSONObject();
modify.put(key, value);
return modify;
}
}

@ -358,6 +358,37 @@ public class PartnerViewController {
return tradeLogService.getOrdersCount(account);
}
@PartnerMapping(value = "/switch_gateway_v2", method = RequestMethod.PUT)
@ResponseBody
public void changeGatewayVersion(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeGatewayVersion(account, pass.getBooleanValue("enable_gateway_version2"));
}
@PartnerMapping(value = "/verify_ip", method = RequestMethod.PUT)
@ResponseBody
public void changeVerifyIp(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.changeVerifyIp(account, pass.getBooleanValue("verify_ip"));
}
@PartnerMapping(value = "/ip_whitelist", method = RequestMethod.PUT)
@ResponseBody
public void setIpWhitelistConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) {
clientManager.setIpWhitelistConfig(account, config.getString("ip_whitelist"));
}
@PartnerMapping(value = "/partner_public_key", method = RequestMethod.PUT)
@ResponseBody
public void setPartnerPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) {
clientManager.setPartnerPublicKeyConfig(account, config.getString("partner_public_key"));
}
@PartnerMapping(value = "/refresh_platform_public_key", method = RequestMethod.PUT)
@ResponseBody
public void refreshPlatformPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.refreshPlatformPublicKeyConfig(account);
}
@PartnerMapping(value = "/payment_page_version", method = RequestMethod.PUT)
@ResponseBody
public void changePaymentPage(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 KiB

After

Width:  |  Height:  |  Size: 2.1 MiB

@ -349,6 +349,38 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
}]);
app.controller('clientResetPartnerPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign', function ($scope, $http,gateway_sign) {
$scope.gateway_sign = angular.copy(gateway_sign);
$scope.uploadPublicKey = function (mch_public_key) {
$scope.errmsg = null;
$http.put('/client/partner_info/partner_public_key', {partner_public_key:mch_public_key}).then(function () {
$scope.$close();
}, function (resp) {
$scope.errmsg = resp.data.message;
})
}
}]);
app.controller('clientRefreshPlatformPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign','commonDialog', function ($scope, $http,gateway_sign,commonDialog) {
$scope.gateway_sign = angular.copy(gateway_sign);
$scope.copyPublicKey = function() {
var e=document.getElementById("c-cpKey");
e.select();
var successful = document.execCommand("Copy");
if (successful) {
commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'});
}else {
commonDialog.alert({title: 'Error', content: '您的浏览器不支持!请手动复制', type: 'error'});
}
};
$scope.refreshPublicKey = function () {
$scope.errmsg = null;
$http.put('/client/partner_info/refresh_platform_public_key').then(function () {
$scope.$close();
}, function (resp) {
$scope.errmsg = resp.data.message;
})
}
}]);
app.controller('clientResetRefundPwdDialogCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.updateRefundPwd = function (refundPwd) {
$scope.errmsg = null;
@ -570,6 +602,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
$scope.paymentInfo = $scope.partner;
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
$scope.qrConfig = {currency: 'AUD'};
$scope.ctrl = {
switch_gateway_v2: false,
switch_verify_ip: false
};
$scope.clientCopyHfLink = function() {
var e=document.getElementById("c-cpbt");
@ -582,6 +618,91 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
};
$scope.loadPartnerPaymentInfo = function () {
$http.get('/client/partner_info').then(function (resp) {
$scope.paymentInfo = resp.data;
})
};
$scope.switchGatewayV2 = function () {
if (!$scope.paymentInfo) {
return;
}
if (!$scope.ctrl.switch_gateway_v2) {
$scope.ctrl.switch_gateway_v2 = true;
return;
}
$http.put('/client/partner_info/switch_gateway_v2', {enable_gateway_version2: $scope.paymentInfo.enable_gateway_version2}).then(function () {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({
title: 'failed to change Gateway Version',
content: resp.data.message,
type: 'error'
})
})
};
$scope.switchVerifyIp = function () {
if (!$scope.paymentInfo.gateway_sign) {
return;
}
if (!$scope.ctrl.switch_verify_ip) {
$scope.ctrl.switch_verify_ip = true;
return;
}
$http.put('/client/partner_info/verify_ip', {verify_ip: $scope.paymentInfo.gateway_sign.verify_ip}).then(function () {
$scope.loadPartnerPaymentInfo();
}, function (resp) {
commonDialog.alert({
title: 'failed to change Verify IP',
content: resp.data.message,
type: 'error'
})
})
};
$scope.clientSaveIpWhitelistConfig = function (config) {
$http.put('/client/partner_info/ip_whitelist', {ip_whitelist: config}).then(function () {
$scope.ctrl.editIpWhitelistConfig = false;
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
};
$scope.resetPartnerPubliKey = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_reset_public_key_dialog.html',
controller: 'clientResetPartnerPublicKeyDialogCtrl',
backdrop: false,
size: 'lg',
resolve: {
gateway_sign: function () {
return $scope.paymentInfo.gateway_sign;
}
}
}).result.then(function () {
commonDialog.alert({title: 'Success!', content: 'Partner Public Key Upload Successfully', type: 'success'})
$scope.loadPartnerPaymentInfo();
})
};
$scope.refreshPlatformPubliKey = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_refresh_platform_public_key_dialog.html',
controller: 'clientRefreshPlatformPublicKeyDialogCtrl',
backdrop: false,
size: 'lg',
resolve: {
gateway_sign: function () {
return $scope.paymentInfo.gateway_sign;
}
}
}).result.then(function () {
commonDialog.alert({title: 'Success!', content: 'RoyalPay Public Key Refresh Successfully', type: 'success'})
$scope.loadPartnerPaymentInfo();
})
};
$scope.resetRefundPwd = function (account) {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_reset_refund_pwd_dialog.html',

@ -127,6 +127,78 @@
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Gateway Version 2
<div class="pull-right">
Develop Document:
<a href="/docs/cn/" target="_blank">中文</a>|
<a href="/docs/en/" target="_blank">English</a>
</div>
</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 Gateway Version 2</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_gateway_version2" bs-switch
switch-change="switchGatewayV2()">
</div>
</div>
<div ng-if="paymentInfo.enable_gateway_version2">
<div class="form-group">
<label class="col-sm-2 control-label">RoyalPay Public Key</label>
<div class="col-sm-10" style="margin-top: 8px;">
<a role="button" ng-click="refreshPlatformPubliKey()">
View
</a>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Partner Public Key</label>
<div class="col-sm-10" style="margin-top: 8px;">
<a role="button" ng-click="resetPartnerPubliKey()">
Upload
</a>
</div>
</div>
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Verify IP</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.gateway_sign.verify_ip" bs-switch
switch-change="switchVerifyIp()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">IP Whitelist</label>
<div class="col-sm-10">
<p ng-if="!ctrl.editIpWhitelistConfig" class="form-control-static">
{{paymentInfo.gateway_sign.ip_whitelist||'Not Configure'}}
<a role="button" ng-click="ctrl.editIpWhitelistConfig=true" ng-if="'01'|withRole"><i
class="fa fa-edit"></i></a> <span style="font-size:9px;padding-left: 40px">多个IP用逗号隔开</span>
</p>
<div class="input-group" ng-if="ctrl.editIpWhitelistConfig">
<input type="text" class="form-control" ng-model="paymentInfo.gateway_sign.ip_whitelist"
title="Prevent not enough refund">
<div class="input-group-btn">
<button class="btn btn-success"
ng-click="clientSaveIpWhitelistConfig(paymentInfo.gateway_sign.ip_whitelist)">
<i class="fa fa-check"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" ng-click="ctrl.editIpWhitelistConfig=false">
<i class="fa fa-remove"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-if="partner.enable_hf&&partner.hf_pay_url">
<div class="panel-heading">HF Pay Link
</div>

@ -0,0 +1,33 @@
<style>
.modal-class {
}
.modal-lg {
width: 40%;
max-width: 400px;
}
</style>
<div class="modal-header">
<h4>RoyalPay Public Key</h4>
</div>
<div class="modal-body" style="height: 400px;">
<form novalidate name="resetForm">
<div class="form-group">
<label class="control-label" style="font-size: 20px;">RoyalPay Public key
</label>
<i class="fa fa-clipboard margin-r-5" style="cursor: pointer;float: right;" ng-click="copyPublicKey()"></i>
<textarea style="height: 250px;margin-top: 15px"
id="c-cpKey" class="form-control" ng-model="gateway_sign.platform_public_key" name="public-key" readonly></textarea>
</div>
<button class="btn btn-warning" type="button" ng-click="refreshPublicKey()" ng-if="'111'|withRole">
<a role="button"
title="refresh">
<i class="fa fa-refresh"></i>
</a>
Refresh RoyalPay Public Key</button>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>

@ -0,0 +1,30 @@
<style>
.modal-class {
}
.modal-lg {
width: 40%;
max-width: 400px;
}
</style>
<div class="modal-header">
<h4>Upload Partner Public Key</h4>
</div>
<div class="modal-body" style="height: 400px;">
<form novalidate name="resetForm">
<div class="form-group">
<label class="control-label" style="font-size: 20px;" for="public-key-input">Upload Public key
*</label>
<textarea style="height: 250px;margin-top: 15px"
id="public-key-input" class="form-control" ng-model="gateway_sign.mch_public_key" name="public-key" required></textarea>
<p class="text-info">
Preserve the middle part and make sure it ends up all on one line
</p>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-click="uploadPublicKey(gateway_sign.mch_public_key)">Submit</button>
<button class="btn btn-danger" type="button" ng-click="$dismiss()">Cancel</button>
</div>
Loading…
Cancel
Save