合并代码

master
dalong306 3 years ago
commit ab3a65c6a9

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.mappers.system.aps;
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
import com.alibaba.fastjson.JSONObject;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
@AutoMapper(tablename = "sys_client_aps_config", pkName = "id")
public interface ApsConfigMapper {
@AutoSql(SqlType.SELECT)
ApsConfigData findByClientId(@Param("client_id") String clientId);
@AutoSql(SqlType.INSERT)
void saveApsConfigClientId(ApsConfigData apsConfigData);
void updateApsConfigClientId(JSONObject apsConfigData);
}

@ -0,0 +1,13 @@
package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
import com.alibaba.fastjson.JSONObject;
public interface ApsConfigService {
ApsConfigData getApsConfigByClientId(String clientId);
ApsConfigData saveApsConfigClientId(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor);
ApsConfigData updateApsConfigClientId(String managerId,String clientId, JSONObject apsConfig);
}

@ -0,0 +1,17 @@
package au.com.royalpay.payment.manage.merchants.core.descriptor;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ApsConfigDescriptor {
private Boolean enableAlipayAps = false;
private Boolean alipayCnSwitch = false;
}

@ -0,0 +1,38 @@
package au.com.royalpay.payment.manage.merchants.core.impls;
import au.com.royalpay.payment.manage.mappers.system.aps.ApsConfigMapper;
import au.com.royalpay.payment.manage.merchants.core.ApsConfigService;
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class ApsConfigServiceImpl implements ApsConfigService {
@Resource
private ApsConfigMapper apsConfigMapper;
@Override
public ApsConfigData getApsConfigByClientId(String clientId) {
return apsConfigMapper.findByClientId(clientId);
}
@Override
public ApsConfigData saveApsConfigClientId(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor) {
ApsConfigData apsConfigData = ApsConfigData.saveData(managerId, clientId, apsConfigDescriptor);
apsConfigMapper.saveApsConfigClientId(apsConfigData);
return apsConfigMapper.findByClientId(clientId);
}
@Override
public ApsConfigData updateApsConfigClientId(String managerId, String clientId, JSONObject apsConfig) {
apsConfig.put("clientId", clientId);
apsConfig.put("modifier", managerId);
apsConfigMapper.updateApsConfigClientId(apsConfig);
return apsConfigMapper.findByClientId(clientId);
}
}

@ -58,13 +58,12 @@ import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMap
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
import au.com.royalpay.payment.manage.merchants.core.*;
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBank;
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankClientNullException;
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankInfo;
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
import au.com.royalpay.payment.manage.merchants.entity.impls.*;
import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum;
import au.com.royalpay.payment.manage.notice.core.MailService;
@ -333,6 +332,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private PaymentApi paymentApi;
@Resource
private MerchantChannelPermissionManager merchantChannelPermissionManager;
@Resource
private ApsConfigService apsConfigService;
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
@ -360,7 +361,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private String agreetemplatePdfPath;
@Value("${app.agreetemplate.aggregate.path}")
private String aggregateAgreetemplatePdfPath;
// private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf";
// private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf";
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2021/09/07/1630997571126_fqWcLQ5Rx0wFm8pVwpKuI1gjf6FmwX.pdf";
@ -558,7 +559,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) {
client.put("enable_alipayplus", true);
}
ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id"));
if (apsConfig == null) {
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor());
}
client.put("aps_config_id", apsConfig.getId());
client.put("enable_alipayaps", apsConfig.getEnableAlipayAps());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
return client;
}
@ -1587,11 +1594,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new NotFoundException("Client Not Exists");
}
merchantChannelPermissionManager.switchMerchantChannelPermission(channelApi.getMetadata().payChannel(), client.getIntValue("client_id"), allow);
try {
clientModifySupport.processModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
} catch (Exception e) {
logger.error("Failed to change channel switch:{}", channel);
if (channelApi.channel().equalsIgnoreCase("alipayaps")) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("enableAlipayAps", allow);
apsConfigService.updateApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), jsonObject);
} else {
merchantChannelPermissionManager.switchMerchantChannelPermission(channelApi.getMetadata().payChannel(), client.getIntValue("client_id"), allow);
try {
clientModifySupport.processModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
} catch (Exception e) {
logger.error("Failed to change channel switch:{}", channel);
}
}
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))) {
@ -2054,12 +2067,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} else {
List<JSONObject> existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel);
existRate.stream().filter(existConfig -> {
if (existConfig.getDate("active_time").equals(config.getDate("active_time")) && existConfig.getDate("expiry_time").equals(config.getDate("expiry_time"))) {
return false;
}
return true;
}
)
if (existConfig.getDate("active_time").equals(config.getDate("active_time")) && existConfig.getDate("expiry_time").equals(config.getDate("expiry_time"))) {
return false;
}
return true;
}
)
.forEach((rateLog) -> {
rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1));
clientRateMapper.updateConfig(rateLog);
@ -2984,24 +2997,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException("The Partner's Rate is not config!");
}
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
client.put("clean", "T+"+weChatRate.getString("clean_days"));
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
client.put("located_country", "Australia");
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
// clean_1 clean_1_friday clean_1_saturday
// second, third or fourth
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
}
try {
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
@ -3120,19 +3133,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("wechat_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
client.put("clean", "T+" + p.getString("clean_days"));
client.put("clean_days", p.getString("clean_days"));
if("1".equalsIgnoreCase(p.getString("clean_days"))){
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
}else if("2".equalsIgnoreCase(p.getString("clean_days"))){
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
}else if("3".equalsIgnoreCase(p.getString("clean_days"))){
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
if ("1".equalsIgnoreCase(p.getString("clean_days"))) {
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
} else if ("2".equalsIgnoreCase(p.getString("clean_days"))) {
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
} else if ("3".equalsIgnoreCase(p.getString("clean_days"))) {
client.put("clean_1", p.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
}
} else if ("Alipay".equals(rate_name)) {
client.put("alipay_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
@ -3209,21 +3222,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
client.put("located_country", "Australia");
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
// clean_1 clean_1_friday clean_1_saturday
// second, third or fourth
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
}
try {
@ -4110,21 +4123,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("clean", "T+" + weChatRate.getString("clean_days"));
client.put("clean_days", weChatRate.getString("clean_days"));
client.put("located_country", "Australia");
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
// clean_1 clean_1_friday clean_1_saturday
// second, third or fourth
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "first");
client.put("clean_1_saturday", "second");
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "second");
client.put("clean_1_saturday", "third");
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
client.put("clean_1", weChatRate.getString("clean_days"));
client.put("clean_1_friday", "third");
client.put("clean_1_saturday", "fourth");
}
String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates");
JSONObject sysConfigRate = JSON.parseObject(rateConfig);
@ -4205,7 +4218,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
logs.forEach(log -> log.put("padding", log.getBooleanValue("editable")));
JSONObject result = PageListUtils.buildPageListResult(logs);
result.put("padding", logs.stream().anyMatch(log->log.getBooleanValue("editable")));
result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable")));
logger.info("##editable{}", result.getBooleanValue("padding"));
return result;
}

@ -0,0 +1,46 @@
package au.com.royalpay.payment.manage.merchants.entity;
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class ApsConfigData implements Serializable {
private String id;
private String creator;
private Date createTime;
private String modifier;
private Date modifyTime;
private String clientId;
private Boolean enableAlipayAps;
private Boolean alipayCnSwitch;
public static ApsConfigData saveData(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor) {
return new ApsConfigData()
.setClientId(clientId)
.setId(UUID.randomUUID().toString().replace("-", ""))
.setAlipayCnSwitch(apsConfigDescriptor.getAlipayCnSwitch())
.setEnableAlipayAps(apsConfigDescriptor.getEnableAlipayAps())
.setCreator(managerId)
.setCreateTime(new Date());
}
}

@ -0,0 +1,55 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.manage.merchants.core.ApsConfigService;
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/sys/partners/aps")
public class ApsConfigController {
@Resource
private ApsConfigService apsConfigService;
/**
* aps
*
* @param clientId
* @return
*/
@GetMapping("/{clientId}")
public ApsConfigData getApsConfigByClientId(@PathVariable("clientId") String clientId) {
return apsConfigService.getApsConfigByClientId(clientId);
}
/**
* aps
*
* @param clientId
* @param apsConfigDescriptor
* @return
*/
@ManagerMapping(value = "/{clientId}", method = RequestMethod.POST, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER })
public ApsConfigData saveApsConfigClientId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable("clientId") String clientId, @RequestBody ApsConfigDescriptor apsConfigDescriptor) {
return apsConfigService.saveApsConfigClientId(manager.getString("managerId"), clientId, apsConfigDescriptor);
}
/**
* aps
*
* @param clientId
* @param apsConfig
* @return
*/
@ManagerMapping(value = "/{clientId}", method = RequestMethod.PUT, role = { ManagerRole.ADMIN,ManagerRole.OPERATOR,ManagerRole.SITE_MANAGER })
public ApsConfigData updateApsConfigClientId(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable("clientId") String clientId, @RequestBody JSONObject apsConfig) {
return apsConfigService.updateApsConfigClientId(manager.getString("managerId"),clientId, apsConfig);
}
}

@ -4,7 +4,7 @@ spring:
host: 192.168.0.92:3306
jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
password: SuTUUxyvzS0cLETi6Rzm
schema-name: royalpay_payment
schema-name: royalpay
username: rpaydev
slave:
host: 192.168.0.84:3306
@ -13,20 +13,71 @@ spring:
schema-name: royalpay
username: root
type: com.zaxxer.hikari.HikariDataSource
#spring:
# datasource:
# master:
# host: office.geekforbest.com:33306
# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# username: rpaydev_out
# schema-name: royalpay
# password: SuTUUxyvzS0cLETi6Rzm
# slave:
# host: 192.168.0.84:3306
# jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
# password: rpayplus123
# schema-name: royalpay
# username: root
# type: com.zaxxer.hikari.HikariDataSource
#spring:
# datasource:
# master:
# host: 127.0.0.1:3306
# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# password: dalong
# schema-name: royalpay_payment
# username: root
# slave:
# host: 127.0.0.1:3306
# jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# password: dalong
# schema-name: royalpay_payment
# username: root
# type: com.zaxxer.hikari.HikariDataSource
#spring:
# datasource:
# master:
# host: 119.28.3.196:3310
# jdbc-url: jdbc:mysql://${spring.datasource.master.host}/${spring.datasource.master.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# password: read0nly
# schema-name: royalpay_production
# username: readonly
# slave:
# host: 119.28.3.196:3310
# jdbc-url: jdbc:mysql://${spring.datasource.slave.host}/${spring.datasource.slave.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
# password: read0nly
# schema-name: royalpay_production
# username: readonly
# type: com.zaxxer.hikari.HikariDataSource
redis:
database: 1
host: 192.168.0.84
host: 127.0.0.1
port: 6379
# redis:
# database: 1
# host: 192.168.0.84
# port: 6379
mail:
host: smtp.exmail.qq.com
port: 465
app:
run-tasks: false
host:
main: http://192.168.0.38:5000/
main: http://192.168.0.14:8888/
regions:
au: http://192.168.0.38:5000/
cn: http://192.168.0.38:5000/
au: http://192.168.0.14:8888/
cn: http://192.168.0.14:8888/
mail:
appid: 1
host: https://dev.mailsupport.hcqtech.com

@ -1,23 +1,23 @@
app:
wechatpay:
api-host: https://apihk.mch.weixin.qq.com
api-host: https://api.mch.weixin.qq.com
merchants:
'1307485301':
app-id: wx703febcbd34dae38
example-sub-merchant-id: 11755174
key-file: classpath:apiclient_cert.p12
key-file: /Users/qingjiaoxuan/extra/apiclient_cert.p12
mch-key: 7e2d8c4aab15e4cabec1207ba79086b1
merchant-id: 1307485301
'1431999902':
app-id: wx703febcbd34dae38
example-sub-merchant-id: 42991963
key-file: classpath:apiclient_new_cert.p12
key-file: /Users/qingjiaoxuan/extra/apiclient_new_cert.p12
mch-key: p3tgzrAJbe6eQrunbv8jb8gz5yXxvJdE
merchant-id: 1431999902
'1487387142':
app-id: wx3e14d1144d898197
example-sub-merchant-id: 117551742
key-file: classpath:napclient_cert.p12
key-file: /Users/qingjiaoxuan/extra/napclient_cert.p12
mch-key: OuvLIL93STqFhTngNaBGT8751ZJn4FKL
merchant-id: 1487387142
mp-id: globalpay

@ -2,7 +2,7 @@ server:
port: 5555
spring:
profiles:
active: dev,alipay,bestpay,jd,wechat,rpay,yeepay,rppaysvc,common
active: dev,alipay,bestpay,jd,wechat,rpay,yeepay,rppaysvc,common,alipayplusaps
mail:
host: ''
port: ''

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.aps.ApsConfigMapper">
<resultMap type="au.com.royalpay.payment.manage.merchants.entity.ApsConfigData" id="ApsConfigResult">
<result property="id" column="id"/>
<result property="creator" column="creator"/>
<result property="createTime" column="create_time"/>
<result property="modifier" column="modifier"/>
<result property="modifyTime" column="modify_time"/>
<result property="enableAlipayAps" column="enable_alipayaps"/>
<result property="alipayCnSwitch" column="alipay_cn_switch"/>
<result property="clientId" column="client_id"/>
</resultMap>
<update id="updateApsConfigClientId">
UPDATE sys_client_aps_config SET modify_time = now(), modifier = #{modifier}
<if test="alipayCnSwitch !=null">, alipay_cn_switch = #{alipayCnSwitch}</if>
<if test="enableAlipayAps !=null">, enable_alipayaps = #{enableAlipayAps}</if>
WHERE client_id = #{clientId}
</update>
</mapper>

File diff suppressed because it is too large Load Diff

@ -108,28 +108,28 @@
<label class="col-sm-3 control-label">Max Order Amount</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editMaxOrderAmount" class="form-control-static">
{{(paymentInfo.max_order_amount|currency:'AUD ')||'Not Configure'}}
{{(paymentInfo.max_order_amount | currency:'AUD ') || 'Not Configure'}}
<a role="button" ng-click="ctrl.editMaxOrderAmount=true"><i class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editMaxOrderAmount">
<div class="input-group-addon">AUD</div>
<input type="number" class="form-control" ng-model="paymentInfo.max_order_amount"
title="Max Order Amount">
title="Max Order Amount">
<div class="input-group-btn">
<button class="btn btn-success" title="Save"
ng-click="saveMaxOrderAmount(paymentInfo.max_order_amount)">
ng-click="saveMaxOrderAmount(paymentInfo.max_order_amount)">
<i class="fa fa-check"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" title="Clear Limit"
ng-click="saveMaxOrderAmount(null)">
ng-click="saveMaxOrderAmount(null)">
<i class="fa fa-ban"></i>
</button>
</div>
<div class="input-group-btn">
<button class="btn btn-danger" title="Cancel"
ng-click="ctrl.editMaxOrderAmount=false">
ng-click="ctrl.editMaxOrderAmount=false">
<i class="fa fa-remove"></i>
</button>
</div>
@ -140,19 +140,19 @@
<label class="col-sm-3 control-label">Customer Surcharge Rate</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editCustomerSurchargeRate" class="form-control-static">
{{paymentInfo.customer_surcharge_rate||'Not Configure'}}
{{paymentInfo.customer_surcharge_rate || 'Not Configure'}}
<a role="button" ng-click="ctrl.editCustomerSurchargeRate=true"><i
class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editCustomerSurchargeRate">
<input type="number" class="form-control" ng-model="paymentInfo.customer_surcharge_rate"
title="Customer Surcharge Rate" max="{{paymentInfo.max_customer_surcharge_rate}}"
min="{{paymentInfo.min_customer_surcharge_rate}}" name="customer_surcharge_rate">
title="Customer Surcharge Rate" max="{{paymentInfo.max_customer_surcharge_rate}}"
min="{{paymentInfo.min_customer_surcharge_rate}}" name="customer_surcharge_rate">
<div class="input-group-addon">%</div>
<div class="input-group-btn">
<button class="btn btn-success" title="Save"
ng-click="saveCustomerSurchargeRate(paymentInfo.customer_surcharge_rate)">
ng-click="saveCustomerSurchargeRate(paymentInfo.customer_surcharge_rate)">
<i class="fa fa-check"></i>
</button>
</div>
@ -163,7 +163,7 @@
</div>
<div class="input-group-btn">
<button class="btn btn-danger" title="Cancel"
ng-click="ctrl.editCustomerSurchargeRate=false">
ng-click="ctrl.editCustomerSurchargeRate=false">
<i class="fa fa-remove"></i>
</button>
</div>
@ -178,16 +178,16 @@
<label class="col-sm-3 control-label">Order Expiry Config</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editOrderExpiryConfig" class="form-control-static">
{{paymentInfo.order_expiry_config||'Not Configure'}}
{{paymentInfo.order_expiry_config || 'Not Configure'}}
<a role="button" ng-click="ctrl.editOrderExpiryConfig=true" ng-if="'01'|withRole"><i
class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editOrderExpiryConfig">
<input type="text" class="form-control" ng-model="paymentInfo.order_expiry_config"
title="Prevent not enough refund">
title="Prevent not enough refund">
<div class="input-group-btn">
<button class="btn btn-success"
ng-click="saveOrderExpiryConfig(paymentInfo.order_expiry_config)">
ng-click="saveOrderExpiryConfig(paymentInfo.order_expiry_config)">
<i class="fa fa-check"></i>
</button>
</div>
@ -218,21 +218,21 @@
<label class="col-xs-6 control-label">Alipay|支付宝</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_alipay" bs-switch
ng-change="toggleChannel('alipay')">
ng-change="toggleChannel('alipay')">
</div>
</div>
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">WeChat|微信</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_wechat" bs-switch
ng-change="toggleChannel('wechat')">
ng-change="toggleChannel('wechat')">
</div>
</div>
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">CB BankPay|快捷支付</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_cb_bankpay" bs-switch
ng-change="toggleChannel('cb_bankpay')">
ng-change="toggleChannel('cb_bankpay')">
</div>
</div>
@ -240,21 +240,28 @@
<label class="col-xs-6 control-label">Card Payment|银行卡支付</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_rpaypmt_card" bs-switch
ng-change="toggleChannel('rpaypmt_card')">
ng-change="toggleChannel('rpaypmt_card')">
</div>
</div>
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">Direct Debit|银行账户支付</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_rpaypmt_dd" bs-switch
ng-change="toggleChannel('rpaypmt_dd')">
ng-change="toggleChannel('rpaypmt_dd')">
</div>
</div>
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">Alipay+|支付宝</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_alipayplus" bs-switch
ng-change="toggleChannel('alipayplus')">
ng-change="toggleChannel('alipayplus')">
</div>
</div>
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">Alipay+(APS)</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.enable_alipayaps" bs-switch
ng-change="toggleChannel('alipayaps')">
</div>
</div>
</div>
@ -274,7 +281,7 @@
<label class="col-sm-2 control-label">Customer Pay for Surcharge On QRCode</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.qrcode_surcharge" bs-switch
switch-change="updateClientQRCodePaySurCharge()">
switch-change="updateClientQRCodePaySurCharge()">
</div>
</div>
<div class="form-group">
@ -290,13 +297,13 @@
<input type="checkbox" ng-model="qrConfig.preauth" ng-change="reloadQRCode()">
Pre Authorization
<i class="fa fa-question-circle text-gray"
uib-tooltip="Pre Authorize means this bill will not be settled until completion"></i>
uib-tooltip="Pre Authorize means this bill will not be settled until completion"></i>
</label>
<label>
<input type="checkbox" ng-model="qrConfig.customerrate" ng-change="reloadQRCode()">
Customer Pay for Surcharge
<i class="fa fa-question-circle text-gray"
uib-tooltip="Customer pay for rate means after customer input the price, system will add rate value into the final price. Client will receive full value customer input after settlement. 客户支付费率勾选后将自动在输入金额基础上加上手续费金额,商户将在清算时收到用户输入的金额"></i>
uib-tooltip="Customer pay for rate means after customer input the price, system will add rate value into the final price. Client will receive full value customer input after settlement. 客户支付费率勾选后将自动在输入金额基础上加上手续费金额,商户将在清算时收到用户输入的金额"></i>
</label>
</p>
@ -327,7 +334,7 @@
</p>
<p>
<a ng-href="/sys/partners/{{partner.client_moniker}}/qrcode_board/aggregate?currency={{qrConfig.currency}}&preauth={{qrConfig.preauth==true}}&qrcode={{qrConfig.qrcode==true}}&customerrate={{qrConfig.customerrate==true}}"
download><i class="fa fa-download"></i> Download Aggregate QR Board Image
download><i class="fa fa-download"></i> Download Aggregate QR Board Image
(聚合支付水晶立牌:支持支付宝、微信、翼支付)</a>
</p>
</div>
@ -344,28 +351,28 @@
<label class="col-sm-2 control-label">Enable Socket</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_gateway" bs-switch
switch-change="toggleGateway()">
switch-change="toggleGateway()">
</div>
</div>
<div class="form-group" ng-if="'gateway_upgrade'|withFunc">
<label class="col-sm-2 control-label">Upgrade QRCode</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.gateway_upgrade" bs-switch
switch-change="toggleGatewayUpgrade()">
switch-change="toggleGatewayUpgrade()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Use Alipay Online</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.gateway_alipay_online" bs-switch
switch-change="toggleGatewayAlipayOnline()">
switch-change="toggleGatewayAlipayOnline()">
</div>
</div>
<div class="form-group" ng-if="'api_surcharge'|withFunc">
<label class="col-sm-2 control-label">Customer Pay for Surcharge On Gateway</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.api_surcharge" bs-switch
switch-change="updateClientApiSurCharge()">
switch-change="updateClientApiSurCharge()">
<p class="text-info">
<i class="fa fa-info"></i> If client have already attached surcharge in their own system, ignore
this choice.<br>
@ -380,8 +387,8 @@
<label class="col-sm-2 control-label">Alipay Channel</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.alipay_payment_channels" bs-switch
data-on-text="Alipay+" data-off-text="Alipay" data-off-color="primary"
ng-change="setAlipayChannel()">
data-on-text="Alipay+" data-off-text="Alipay" data-off-color="primary"
ng-change="setAlipayChannel()">
</div>
</div>
<div class="form-group">
@ -453,29 +460,29 @@
<label class="col-sm-2 control-label">CB Bank Pay Link</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_cb_bankpay_link" bs-switch
ng-change="toggleCBBankPayLink()">
ng-change="toggleCBBankPayLink()">
&nbsp;&nbsp;<a href={{paymentInfo.cb_bankpay_url}} target="_Blank"><span
ng-if="paymentInfo.enable_cb_bankpay_link">{{paymentInfo.cb_bankpay_url}}</span></a>
ng-if="paymentInfo.enable_cb_bankpay_link">{{paymentInfo.cb_bankpay_url}}</span></a>
<i ng-if="paymentInfo.enable_cb_bankpay_link" class="fa fa-clipboard margin-r-5"
style="cursor: pointer" ng-click="copyCBBankPayLink()"></i>
style="cursor: pointer" ng-click="copyCBBankPayLink()"></i>
<input ng-if="paymentInfo.enable_cb_bankpay_link" style="opacity: 0" id="cpcbbankpay"
value={{paymentInfo.cb_bankpay_url}} readonly>
value={{paymentInfo.cb_bankpay_url}} readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Customer Pay for Surcharge for CBBank Pay</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.cbbank_surcharge" bs-switch
ng-change="updateClientCBBankPaySurCharge()">
ng-change="updateClientCBBankPaySurCharge()">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">CB Bank Pay Channel</label>
<div class="col-sm-3">
<select class="form-control" name="industry"
ng-change="updateCBBankPayConfig('cb_channel_id',partner.cb_channel_id)"
ng-model="partner.cb_channel_id" id="cbbankpay-input" required
ng-options="channel.channel_id as channel.channel_name for channel in cb_bankpay">
ng-change="updateCBBankPayConfig('cb_channel_id',partner.cb_channel_id)"
ng-model="partner.cb_channel_id" id="cbbankpay-input" required
ng-options="channel.channel_id as channel.channel_name for channel in cb_bankpay">
<option value="">跟随系统</option>
</select>
</div>
@ -483,7 +490,7 @@
<div class="form-group" ng-if="paymentInfo.enable_cb_bankpay && paymentInfo.enable_cb_bankpay_link">
<label class="col-sm-2 control-label">CB Bank Pay QR Code</label>
<div class="col-sm-10">
<img ng-src="{{paymentInfo.cbBankPayQrcodeUrl}}" class="img-responsive" />
<img ng-src="{{paymentInfo.cbBankPayQrcodeUrl}}" class="img-responsive"/>
<div>
&nbsp;&nbsp;<span style="padding-left: 4.2%;font-size:9px;">仅支持微信客户端扫描</span>
</div>
@ -498,7 +505,7 @@
<label class="col-sm-4 control-label">Select Version</label>
<div class="col-sm-6">
<select class="form-control" ng-change="changeCBBankPaymentPage()"
ng-model="paymentInfo.cbbank_paypad_version" title="Payment Page">
ng-model="paymentInfo.cbbank_paypad_version" title="Payment Page">
<option value="v1">v1</option>
<option value="v2">v2</option>
</select>
@ -507,9 +514,9 @@
<label class="col-sm-4 control-label"></label>
<div class="col-sm-8" style="margin-top: 10px;">
<img style="width: 200px" ng-if="paymentInfo.cbbank_paypad_version=='v1'"
src="/static/images/cbbank_payment_page_v1.jpg">
src="/static/images/cbbank_payment_page_v1.jpg">
<img style="width: 200px" ng-if="paymentInfo.cbbank_paypad_version=='v2'"
src="/static/images/cbbank_payment_page_v2.jpg">
src="/static/images/cbbank_payment_page_v2.jpg">
</div>
</div>
</div>
@ -527,14 +534,31 @@
<label class="col-sm-2 control-label">Enable International Card</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_international_card" bs-switch
switch-change="switchInternationalCard()">
switch-change="switchInternationalCard()">
</div>
</div>
<div class="form-group" ng-if="'111'|withRole">
<label class="col-sm-2 control-label">Enable 3DS</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_threeds" bs-switch
switch-change="switchThreeDS()">
switch-change="switchThreeDS()">
</div>
</div>
</div>
</div>
</div>
<!--AlipayCN支付渠道切换-->
<div class="panel panel-default" ng-if="(('111'|withRole))">
<div class="panel-heading">AlipayCN channel replace</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group col-sm-4">
<label class="col-xs-6 control-label">AlipayCN channel</label>
<div class="col-xs-6">
<input type="checkbox" ng-model="paymentInfo.alipay_cn_switch" bs-switch switch-on-text="APS"
switch-off-text="Alipay"
ng-change="switchAlipayCn(paymentInfo.client_id,paymentInfo.aps_config_id,paymentInfo.alipay_cn_switch)">
</div>
</div>
</div>
@ -550,14 +574,14 @@
<label class="col-sm-2 control-label">Enable Socket</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_retail" bs-switch
switch-change="toggleOffline()">
switch-change="toggleOffline()">
</div>
</div>
<div class="form-group" ng-if="'retail_surcharge'|withFunc">
<label class="col-sm-2 control-label">Customer Pay for Surcharge for Retail</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.retail_surcharge" bs-switch
switch-change="updateClientRetailPaySurCharge()">
switch-change="updateClientRetailPaySurCharge()">
</div>
</div>
</div>
@ -565,14 +589,14 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">Refund </div>
<div class="panel-heading">Refund</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group" ng-if="'1000000000111'|withRole">
<label class="col-sm-2 control-label">Enable Refund</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_refund" bs-switch
switch-change="toggleRefund()">
switch-change="toggleRefund()">
</div>
</div>
@ -580,7 +604,7 @@
<label class="col-sm-2 control-label">Enable Pre-authorize Refund</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.enable_pre_refund" bs-switch
switch-change="togglePreRefund()">
switch-change="togglePreRefund()">
</div>
</div>
@ -589,13 +613,13 @@
<label class="col-sm-2 control-label">Refund Credit Line</label>
<div class="col-sm-9">
<p ng-if="!ctrl.editRefundCreditLine" class="form-control-static">
{{paymentInfo.refund_credit_line||'Not Configure'}}
{{paymentInfo.refund_credit_line || 'Not Configure'}}
<a role="button" ng-click="ctrl.editRefundCreditLine=true" ng-if="'01'|withRole"><i
class="fa fa-edit"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editRefundCreditLine">
<input type="number" maxlength="6" class="form-control"
ng-model="paymentInfo.refund_credit_line">
ng-model="paymentInfo.refund_credit_line">
<div class="input-group-btn">
<button class="btn btn-success" ng-click="setRefundCreditLine()">
<i class="fa fa-check"></i>
@ -619,7 +643,7 @@
</p>
<div class="input-group" ng-if="ctrl.editRefundPwd">
<input type="text" class="form-control" maxlength="6" minlength="1"
ng-model="paymentInfo.new_refund_password">
ng-model="paymentInfo.new_refund_password">
<div class="input-group-btn">
<button class="btn btn-success" ng-click="resetRefundPwd(paymentInfo.new_refund_password)">
<i class="fa fa-check"></i>
@ -646,14 +670,14 @@
<label class="col-sm-2 control-label">Require Customer Information</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_custinfo" bs-switch
switch-change="toggleRequireCustInfo()">
switch-change="toggleRequireCustInfo()">
</div>
</div>
<div class="form-group" ng-if="'1000000000111'|withRole">
<label class="col-sm-2 control-label">Require Remark</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="paymentInfo.require_remark" bs-switch
switch-change="toggleRequireRemark()">
switch-change="toggleRequireRemark()">
</div>
</div>
</div>
@ -668,7 +692,7 @@
<div class="col-sm-10">
<div ng-if="param.type=='boolean'">
<input type="checkbox" ng-model="param.value" bs-switch
ng-change="extChangeParam(param.name,param.value)">
ng-change="extChangeParam(param.name,param.value)">
</div>
<div ng-if="param.type == 'string'">
@ -679,7 +703,7 @@
</p>
<div class="input-group" ng-if="param.flag">
<input type="text" class="form-control" ng-model="param.value"
title="Prevent not enough refund">
title="Prevent not enough refund">
<div class="input-group-btn">
<button class="btn btn-success" ng-click="extChangeParam(param.name,param.value)">
<i class="fa fa-check"></i>
@ -707,31 +731,31 @@
<label class="col-sm-4 control-label">Select Version</label>
<div class="col-sm-6">
<select class="form-control" ng-change="changePaymentPage()" ng-model="paymentInfo.paypad_version"
title="Payment Page">
title="Payment Page">
<option value="v1">v1</option>
<option value="v2">v2</option>
<option value="v3">v3</option>
<option value="v4">v4</option>
<option value="v5">v5</option>
<option value="v6">v6</option>
<!-- <option value="v2101">multiple payment methods</option>-->
<!-- <option value="v2101">multiple payment methods</option>-->
</select>
</div>
<div class="col-sm-12">
<label class="col-sm-4 control-label"></label>
<div class="col-sm-8" style="margin-top: 10px;">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v1'"
src="/static/images/payment_page_v1.jpg">
src="/static/images/payment_page_v1.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v2'"
src="/static/images/payment_page_v2.jpg">
src="/static/images/payment_page_v2.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v3'"
src="/static/images/payment_page_v3.jpg">
src="/static/images/payment_page_v3.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v4'"
src="/static/images/payment_page_v4.jpg">
src="/static/images/payment_page_v4.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v5'"
src="/static/images/payment_page_v5.jpg">
src="/static/images/payment_page_v5.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v6'"
src="/static/images/payment_page_v6.jpg">
src="/static/images/payment_page_v6.jpg">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v2101'"
src="/static/images/payment_page_v2101_step1.png">
<img style="width: 200px" ng-if="paymentInfo.paypad_version=='v2101'"

Loading…
Cancel
Save