合并代码

master
dalong306 4 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");
@ -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,12 +1594,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new NotFoundException("Client Not Exists");
}
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))) {
int clientId = client.getIntValue("client_id");

@ -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>

@ -917,7 +917,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.updateMerchantLocation = function () {
var params = window.frames['merchant_detail'].merchant_location
if (params) {
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {})
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
})
}
}
},
@ -1614,7 +1615,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$http.delete('/sys/partners/' + $scope.partner.client_moniker).then(
function () {
$state.go('^')
commonDialog.alert({ title: 'Delete', content: 'Partner Already Disabled', type: 'error' })
commonDialog.alert({
title: 'Delete',
content: 'Partner Already Disabled',
type: 'error'
})
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
@ -1632,7 +1637,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(
function () {
$state.go('^')
commonDialog.alert({ title: 'Revert', content: 'Partner Already Revert', type: 'success' })
commonDialog.alert({
title: 'Revert',
content: 'Partner Already Revert',
type: 'success'
})
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
@ -1929,7 +1938,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_compliance_permission', {allow: $scope.partner.wechat_compliance}).then(
function () {},
function () {
},
function (resp) {
commonDialog.alert({
title: 'failed to change wechat_compliance permission status',
@ -1952,7 +1962,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/local_merchant_permission', {allow: $scope.partner.local_merchant}).then(
function () {},
function () {
},
function (resp) {
commonDialog.alert({
title: 'failed to change local_merchant permission status',
@ -2282,7 +2293,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '进件失败:' + resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Error',
content: '进件失败:' + resp.data.message,
type: 'error'
})
}
)
})
@ -2310,10 +2325,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
.then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(
function () {
commonDialog.alert({ title: 'Success', content: '提示AlipayOnline进件成功', type: 'success' })
commonDialog.alert({
title: 'Success',
content: '提示AlipayOnline进件成功',
type: 'success'
})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '进件失败:' + resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Error',
content: '进件失败:' + resp.data.message,
type: 'error'
})
}
)
})
@ -2430,6 +2453,29 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
}
}
$scope.switchAlipayCn = function (clientId, apsConfigId, alipayCn) {
if (!$scope.paymentInfo.enable_alipayaps) {
commonDialog.alert({
title: 'ERROR',
content: "AlipayCN channel can be switched only after Alipay+(APS) is enabled",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
} else {
$http.put('/sys/partners/aps/' + clientId, {id: apsConfigId, alipayCnSwitch: alipayCn}).then(
function () {
$scope.loadPartnerPaymentInfo()
},
function (resp) {
commonDialog.alert({
title: 'Failed to change alipayCN channel permission status',
content: resp.data.message,
type: 'error',
})
}
)
}
}
$scope.toggleChannel = function (channel) {
if (!channel) {
return
@ -2441,6 +2487,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
// $scope.init.channel[channel] = true
// return
// }
if($scope.paymentInfo.alipay_cn_switch){
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
}
$scope.getComplianceInfo()
if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' && $scope.paymentInfo.open_status == 5 && info.length > 0) {
commonDialog
@ -3253,7 +3308,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.init.allow_surcharge_credit = true
return
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/allow_surcharge_credit', { allow_surcharge_credit: allowSurchargeCredit }).then(function (resp) {})
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/allow_surcharge_credit', {allow_surcharge_credit: allowSurchargeCredit}).then(function (resp) {
})
}
$scope.taxInSurcharge = function (taxInSurcharge) {
if (!$scope.init.tax_in_surcharge) {
@ -3727,7 +3783,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
$scope.updateAccountRole = function (account) {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/accounts/' + account.account_id + '/role', {role: account.role}).then(
function () {},
function () {
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
@ -4276,7 +4333,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.updateMerchantLocation = function () {
var params = window.frames['merchant_detail'].merchant_location
if (params) {
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {})
$http.put('/sys/partners/modify/' + $scope.partner.client_moniker + '/location', params).then(function () {
})
}
}
},
@ -4575,7 +4633,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.listDevices()
},
function (resp) {
commonDialog.alert({ title: 'Update remark failed', content: resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Update remark failed',
content: resp.data.message,
type: 'error'
})
}
)
})
@ -4586,7 +4648,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.listDevices()
},
function (resp) {
commonDialog.alert({ title: 'Failed to disable device', content: resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Failed to disable device',
content: resp.data.message,
type: 'error'
})
}
)
}
@ -4596,7 +4662,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.listDevices()
},
function (resp) {
commonDialog.alert({ title: 'Failed to enable device', content: resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Failed to enable device',
content: resp.data.message,
type: 'error'
})
}
)
}
@ -5230,6 +5300,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
type: 'error',
})
}
$scope.complianceCheck = function () {
if (!$rootScope.complianceCheck) {
$rootScope.complianceCheck = {}
@ -5643,6 +5714,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
type: 'error',
})
}
$scope.complianceCheck = function () {
if (!$rootScope.complianceCheck) {
$rootScope.complianceCheck = {}
@ -5875,6 +5947,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
type: 'error',
})
}
$scope.complianceCheck = function () {
if (!$rootScope.complianceCheck) {
$rootScope.complianceCheck = {}
@ -6385,67 +6458,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.loadSubMerchantInfos()
})
}
$scope.applyAlipayPlusRetailMerchantId = function () {
$uibModal
.open({
templateUrl: '/static/payment/partner/templates/apply_alipayplus_sub_merchant_id.html',
controller: 'applyAlipayPlusSubMerchantIdCtrl',
resolve: {
subMerchantInfo: function () {
return $scope.partner
},
online: false,
},
})
.result.then(function () {
$scope.loadSubMerchantInfos()
})
}
$scope.applyAlipayPlusOnlineMerchantId = function () {
$uibModal
.open({
templateUrl: '/static/payment/partner/templates/apply_alipayplus_sub_merchant_id.html',
controller: 'applyAlipayPlusSubMerchantIdCtrl',
resolve: {
subMerchantInfo: function () {
return $scope.partner
},
online: true,
},
})
.result.then(function () {
$scope.loadSubMerchantInfos()
})
}
$scope.queryAlipayPlusApsOnline = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_aps_online').then(
function (resp) {
commonDialog.alert({
title: 'AlipayPlus Online Apply Status',
content: resp.data.response_str,
type: 'info',
})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '查询失败:' + resp.data.message, type: 'error' })
}
)
};
$scope.queryAlipayPlusApsRetail = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_aps_retail').then(
function (resp) {
commonDialog.alert({
title: 'AlipayPlus Retail Apply Status',
content: resp.data.response_str,
type: 'info',
})
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '查询失败:' + resp.data.message, type: 'error' })
}
)
};
// 刷新Wechat Sub Merchant Id
$scope.queryWechatSubMerchantIdStatus = function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_merchant_ids/' + $scope.partnerInfo.sub_merchant_id + '/status').then(
@ -6572,7 +6584,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.loadPartnerInfo()
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '进件失败:' + resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Error',
content: '进件失败:' + resp.data.message,
type: 'error'
})
}
)
})
@ -6591,11 +6607,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
.then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(
function () {
commonDialog.alert({ title: 'Success', content: '提示AlipayOnline进件成功', type: 'success' })
commonDialog.alert({
title: 'Success',
content: '提示AlipayOnline进件成功',
type: 'success'
})
$scope.loadPartnerInfo()
},
function (resp) {
commonDialog.alert({ title: 'Error', content: '进件失败:' + resp.data.message, type: 'error' })
commonDialog.alert({
title: 'Error',
content: '进件失败:' + resp.data.message,
type: 'error'
})
}
)
})
@ -7034,133 +7058,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}
},
])
/**
* 申请alipayplus
*/
app.controller('applyAlipayPlusSubMerchantIdCtrl', [
'$scope',
'$http',
'$uibModal',
'$state',
'subMerchantInfo',
'$filter',
'commonDialog',
'online',
function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, commonDialog,online) {
$scope.subMerchantInfo = angular.copy(subMerchantInfo)
$scope.subMerchantInfo.online=online;
$scope.subMerchantInfo.merchantDisplayName = $scope.subMerchantInfo.short_name;
$scope.subMerchantInfo.registrationAddress= $scope.subMerchantInfo.address;
// if ($scope.subMerchantInfo.client_pay_type) {
// if ($scope.subMerchantInfo.client_pay_type.indexOf('1') >= 0 && $scope.subMerchantInfo.client_pay_type.indexOf('2') >= 0) {
// $scope.subMerchantInfo.payment_type_online = true;
// $scope.subMerchantInfo.business_type_offline = true;
// } else if ($scope.subMerchantInfo.client_pay_type.indexOf('1') >= 0) {
// $scope.subMerchantInfo.business_type_offline = true
// } else if ($scope.subMerchantInfo.client_pay_type.indexOf('2') >= 0) {
// $scope.subMerchantInfo.business_type_agreement = true
// }
// } else {
// $scope.subMerchantInfo.payment_type_online = true;
// $scope.subMerchantInfo.business_type_offline = true;
// }
if($scope.subMerchantInfo.online) {
$scope.title = "AlipayPlus-aps(Online)Registration";
}else{
$scope.title = "AlipayPlus-aps(Retail)Registration";
}
$scope.subMerchantInfo.websiteType = 'WEB';
$scope.subMerchantInfo.website= $scope.subMerchantInfo.company_website;
$scope.subMerchantInfo.legalName = $scope.subMerchantInfo.company_name;
$scope.subMerchantInfo.registrationType='OTHER_IDENTIFICATION_NO'
if ($scope.subMerchantInfo.business_structure) {
$scope.subMerchantInfo.businessType = $scope.subMerchantInfo.business_structure != 'Registered body(Sole Trader)' ? 'ENTERPRISE' : 'INDIVIDUAL'
}
$scope.subMerchantInfo.shareholderName= $scope.subMerchantInfo.representativeInfo.representative_person;
$scope.subMerchantInfo.representativeName= $scope.subMerchantInfo.representativeInfo.representative_person;
$scope.subMerchantInfo.storeAddress= $scope.subMerchantInfo.address;
$scope.subMerchantInfo.registrationNo= $scope. subMerchantInfo.acn ? $scope.subMerchantInfo.acn : $scope.subMerchantInfo.abn;
$scope.subMerchantInfo.storeMCC=$scope.subMerchantInfo.alipayindustry;
$scope.subMerchantInfo.storeName=$scope.subMerchantInfo.store_name;
$scope.alipayMccCategory = {}
$scope.loadAlipayCategory = function () {
$http.get('/static/data/alipayMcc.json').then(function (resp) {
$scope.alipayMccCategory = resp.data
})
}
$scope.loadAlipayCategory()
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.subMerchantInfo.alipay_category = selectedItem.label
$scope.subMerchantInfo.alipayindustry = selectedItem.mccCode
}
$scope.onAlipayStoreMccSelect = function (selectedItem) {
$scope.subMerchantInfo.storeMCC_category = selectedItem.label
$scope.subMerchantInfo.storeMCC = selectedItem.mccCode
}
$scope.saveAlipayApply = function (form) {
$scope.errmsg = null
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true
}
})
return;
}
var params = {
websiteType: $scope.subMerchantInfo.websiteType,
merchantDisplayName: $scope.subMerchantInfo.merchantDisplayName,
merchantMCC: $scope.subMerchantInfo.alipayindustry,
legalName: $scope.subMerchantInfo.legalName,
registrationType: $scope.subMerchantInfo.registrationType,
registrationNo: $scope.subMerchantInfo.registrationNo,
businessType: $scope.subMerchantInfo.businessType,
shareholderName: $scope.subMerchantInfo.shareholderName,
shareholderId: $scope.subMerchantInfo.shareholderId,
representativeName: $scope.subMerchantInfo.representativeName,
representativeId: $scope.subMerchantInfo.representativeId,
storeName: $scope.subMerchantInfo.storeName,
storeMCC: $scope.subMerchantInfo.storeMCC,
storeAddress: $scope.subMerchantInfo.storeAddress,
registrationAddress: $scope.subMerchantInfo.registrationAddress,
}
params.productCodes=[];
if($scope.subMerchantInfo.online){
params.productCodes.push('CASHIER_PAYMENT');
}else{
params.productCodes.push('IN_STORE_PAYMENT');
}
params.websites=[]
if($scope.subMerchantInfo.online){
params.websites.push($scope.subMerchantInfo.website);
}
$http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/apply_alipayplus', params).then(
function (resp) {
if(resp.data.success) {
commonDialog.alert({ title: 'Success', content: "注册成功!", type: 'success' })
}else{
commonDialog.alert({title: 'Error', content: "注册失败!", type: 'error'})
}
$scope.$close()
},
function (resp) {
$scope.flag = false
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
}
)
};
},
])
app.controller('updateApplyWxSubMerchantIdCtrl', [
'$scope',
'$http',
@ -7467,7 +7364,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.businessLicence = resp.data.path
merchantInfo['business_licence'] = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.businessLicenceProgress
@ -7621,7 +7522,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.directorPassport = resp.data.path
$scope.directors.filePath = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.directorPassportProgress
@ -7650,7 +7555,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.executivePassport = resp.data.path
$scope.executives.filePath = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.executivePassportProgress
@ -7870,7 +7779,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.businessLicence = resp.data.path
merchantInfo['business_licence'] = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.businessLicenceProgress
@ -8024,7 +7937,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.directorPassport = resp.data.path
$scope.directors.filePath = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.directorPassportProgress
@ -8053,7 +7970,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.executivePassport = resp.data.path
$scope.executives.filePath = resp.data.path
merchantId = resp.data.merchantId
commonDialog.alert({ title: 'Upload Success', content: 'Upload Success', type: 'success' })
commonDialog.alert({
title: 'Upload Success',
content: 'Upload Success',
type: 'success'
})
},
function (resp) {
delete $scope.executivePassportProgress
@ -8145,7 +8066,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.clientPermission.isValid = permission.is_valid
var params = angular.copy($scope.clientPermission)
$http.post('/sys/permission/' + permission.id, params).then(
function (resp) {},
function (resp) {
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}
@ -8155,7 +8077,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.init = function () {
var params = {client_moniker: $scope.partner.client_moniker}
$http.post('/sys/permission/init', params).then(
function (resp) {},
function (resp) {
},
function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}

@ -257,6 +257,13 @@
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>
</div>
</div>
@ -541,6 +548,23 @@
</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>
</div>
</div>
<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-body">

Loading…
Cancel
Save