|
|
|
@ -152,6 +152,126 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
{
|
|
|
|
|
"label": "Medical Service",
|
|
|
|
|
"value": "533"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online games (Top-up)",
|
|
|
|
|
"value": "644"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online Shopping Mall",
|
|
|
|
|
"value": "648"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Supermarket",
|
|
|
|
|
"value": "649"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Convenience Store",
|
|
|
|
|
"value": "651"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Duty-free Shop",
|
|
|
|
|
"value": "652"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Pharmacy",
|
|
|
|
|
"value": "653"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Vending Machine",
|
|
|
|
|
"value": "654"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Department Store /Shopping Centre",
|
|
|
|
|
"value": "655"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Food/Beverages",
|
|
|
|
|
"value": "656"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Catering Services",
|
|
|
|
|
"value": "657"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Furniture/Household Products",
|
|
|
|
|
"value": "658"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Home Appliances/Camera Equipment/Office Equipment",
|
|
|
|
|
"value": "659"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Beauty/Personal Care Products",
|
|
|
|
|
"value": "660"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Flowers/Plants/Interior Decorations/Decorations",
|
|
|
|
|
"value": "661"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Nursery Products/Toys",
|
|
|
|
|
"value": "662"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Clothing/Shoes/Other Accessories",
|
|
|
|
|
"value": "663"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Sports/Fitness Equipment/Security",
|
|
|
|
|
"value": "664"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Watches/Eyewear/Jewellery",
|
|
|
|
|
"value": "665"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Outdoor Products /Travel Products",
|
|
|
|
|
"value": "666"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Books / Records / Stationery / Musical Instruments",
|
|
|
|
|
"value": "667"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Flight ticket/ticketing agent",
|
|
|
|
|
"value": "668"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Sightseeing Passes",
|
|
|
|
|
"value": "669"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Hotel/Resort",
|
|
|
|
|
"value": "670"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online Books/Video/Music",
|
|
|
|
|
"value": "671"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Online games (Download)",
|
|
|
|
|
"value": "672"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "University Education",
|
|
|
|
|
"value": "677"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Public hospitals/Medical Institutions",
|
|
|
|
|
"value": "679"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Private hospitals/Clinics/Medical institutions",
|
|
|
|
|
"value": "678"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Public transit",
|
|
|
|
|
"value": "680"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"label": "Logistics/ Courier Service",
|
|
|
|
|
"value": "684"
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
var removeClientPayDesc = function (items, key) {
|
|
|
|
@ -3138,8 +3258,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('partnerNewSubPartnerDialogCtrl', ['$rootScope', '$scope', '$http', '$state', 'Upload', 'commonDialog', 'timezone',
|
|
|
|
|
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap','wechatGoodMcc',
|
|
|
|
|
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap,wechatGoodMcc) {
|
|
|
|
|
'clientMoniker', 'industryMap', 'businessStructuresMap', 'stateMap', 'countryMap','wechatGoodMcc','$filter',
|
|
|
|
|
function ($rootScope, $scope, $http, $state, Upload, commonDialog, timezone, clientMoniker, industryMap, businessStructuresMap, stateMap, countryMap,wechatGoodMcc,$filter) {
|
|
|
|
|
if ($scope.partner_application) {
|
|
|
|
|
$scope.partner = angular.copy($scope.partner_application);
|
|
|
|
|
delete $rootScope.partner_application;
|
|
|
|
@ -3161,7 +3281,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
$scope.wechatMccIndustries = wechatGoodMcc.configs();
|
|
|
|
|
|
|
|
|
|
$scope.checkExpriedate=function (value) {
|
|
|
|
|
if(value){
|
|
|
|
|
$scope.partner.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.partner.certificat_expire_date_NA=false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.checkExpriedateOther=function (value) {
|
|
|
|
|
if(value=='PERMANENT'){
|
|
|
|
|
if($scope.partner.certificat_expire_date_premanent){
|
|
|
|
|
$scope.partner.certificat_expire_date_NA=false;
|
|
|
|
|
$scope.partner.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}else if(value=='N/A'){
|
|
|
|
|
if($scope.partner.certificat_expire_date_NA){
|
|
|
|
|
$scope.partner.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.partner.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var resetClientPayDescByTpey = function (type) {
|
|
|
|
|
type = parseInt(type);
|
|
|
|
|
if (type == 1) {
|
|
|
|
@ -3352,6 +3490,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
alert('Please select the business structure');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.partner.business_structure!='Registered body(Sole Trader)') {
|
|
|
|
|
if ($scope.partner.certificat_expire_date_d) {
|
|
|
|
|
$scope.partner.certificat_expire_date = $filter('dateConversionStr')($scope.partner.certificat_expire_date_d)
|
|
|
|
|
} else if ($scope.partner.certificat_expire_date_premanent) {
|
|
|
|
|
$scope.partner.certificat_expire_date = "PERMANENT";
|
|
|
|
|
}
|
|
|
|
|
else if ($scope.partner.certificat_expire_date_NA) {
|
|
|
|
|
$scope.partner.certificat_expire_date = "N/A";
|
|
|
|
|
} else {
|
|
|
|
|
alert("Certificate expiration time is required");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($scope.partner.company_name.indexOf("Migration") != -1) {
|
|
|
|
|
alert("Company Name包含敏感词汇,请检查后重新提交!");
|
|
|
|
|
return;
|
|
|
|
@ -5280,7 +5431,194 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
// Merchant Id Management
|
|
|
|
|
app.controller('subMerchantIdApplicaitonsCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', '$sce', function ($scope, $http, $uibModal, $state, commonDialog, $sce) {
|
|
|
|
|
$scope.loadPartnerInfo = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker).then(function (resp) {
|
|
|
|
|
$scope.partnerInfo = resp.data;
|
|
|
|
|
$scope.doSwitchCommonSubMerchantId();
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.loadPartnerInfo()
|
|
|
|
|
// 编辑Wechat Sub Merchant Id
|
|
|
|
|
$scope.saveSubMerchantId = function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', { sub_merchant_id: $scope.partnerInfo.sub_merchant_id }).then(function (resp) {
|
|
|
|
|
$scope.loadPartnerInfo();
|
|
|
|
|
$scope.ctrl.editSubMerchant = false;
|
|
|
|
|
}, 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(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Wechat Apply Status(' + resp.data.apply_status + ")",
|
|
|
|
|
content: resp.data.response_str,
|
|
|
|
|
type: 'info'
|
|
|
|
|
})
|
|
|
|
|
$scope.loadPartnerInfo();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// history
|
|
|
|
|
$scope.showSubMerchantLogs = function () {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/client_sub_merchant_id_log.html',
|
|
|
|
|
controller: 'clientSubMerchantIdLogCtrl',
|
|
|
|
|
size: 'lg',
|
|
|
|
|
resolve: {
|
|
|
|
|
logs: ['$http', function ($http) {
|
|
|
|
|
return $http.get('/sys/partners/' + $scope.partner.client_moniker + '/get_sub_merchant_id_logs');
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
// 刷新Wechat Institution Merchant Id
|
|
|
|
|
$scope.refreshWechatInstitutionMerchantId = function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/wechat_institution_merchant_id', { wechat_institution_merchant_id: $scope.partnerInfo.wechat_institution_merchant_id }).then(function (resp) {
|
|
|
|
|
$scope.loadPartnerInfo()
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// switch开关
|
|
|
|
|
$scope.doSwitchCommonSubMerchantId = function () {
|
|
|
|
|
$("input[name='switch']").bootstrapSwitch({
|
|
|
|
|
onText: "ON",
|
|
|
|
|
offText: "OFF",
|
|
|
|
|
size: 'mini',
|
|
|
|
|
state: $scope.partnerInfo.common_sub_merchant_id,
|
|
|
|
|
onSwitchChange: function (event, state) {
|
|
|
|
|
//监听switch change事件,可以根据状态把相应的业务逻辑代码写在这里
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/common_sub_merchant_id', { allow: state }).then(function () {
|
|
|
|
|
$scope.loadPartnerInfo();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Failed to change common_sub_merchant_id permission status',
|
|
|
|
|
content: resp.data.message,
|
|
|
|
|
type: 'error'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
// Alipay保存名称修改
|
|
|
|
|
$scope.saveAliSubMerchantId = function () {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/ali_sub_merchant_id', { ali_sub_merchant_id: $scope.partnerInfo.ali_sub_merchant_id }).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify Ali Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$scope.loadPartnerInfo();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 刷新Alipay
|
|
|
|
|
$scope.queryAlipayGms = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms').then(function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Success', content: resp.data.result_status, type: 'success' });
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: "查询失败:" + resp.data.message, type: 'error' });
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
// 刷新AlipayOnline
|
|
|
|
|
$scope.queryAlipayOnlineGms = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipayOnline_gms').then(function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Success', content: resp.data.result_status, type: 'success' });
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: "查询失败:" + resp.data.message, type: 'error' });
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// Alipay进件
|
|
|
|
|
$scope.submitAlipaySubId = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms_json').then(function (resp) {
|
|
|
|
|
$scope.alipay_gms_json = resp.data;
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: '是否使用该商户的现有信息进件?',
|
|
|
|
|
json: $scope.alipay_gms_json
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () {
|
|
|
|
|
commonDialog.alert({ title: 'Success', content: 'Alipay进件成功', type: 'success' });
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: "进件失败:" + resp.data.message, type: 'error' });
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
// AlipayOnline进件
|
|
|
|
|
$scope.submitAlipayOnlineSubId = function () {
|
|
|
|
|
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipayOnline_gms_json').then(function (resp) {
|
|
|
|
|
$scope.alipayOnline_gms_json = resp.data;
|
|
|
|
|
commonDialog.confirm({
|
|
|
|
|
title: 'Warning',
|
|
|
|
|
content: '是否使用该商户的现有信息进件?',
|
|
|
|
|
json: $scope.alipayOnline_gms_json
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms').then(function () {
|
|
|
|
|
commonDialog.alert({ title: 'Success', content: '提示:AlipayOnline进件成功', type: 'success' });
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: "进件失败:" + resp.data.message, type: 'error' });
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// use sub_merchant_id
|
|
|
|
|
$scope.useSubMerchantId = function (sub_merchant_id) {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', { sub_merchant_id: sub_merchant_id }).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify Wechat Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 查看sub_merchant_id详情
|
|
|
|
|
$scope.checkDetail = function (merchantInfo, channel) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/sub_merchant_detail.html',
|
|
|
|
|
controller: 'subMerchantDetailCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
subMerchantInfo: function () {
|
|
|
|
|
return merchantInfo
|
|
|
|
|
},
|
|
|
|
|
channel: function () {
|
|
|
|
|
return channel
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 修改sub_merchant_id
|
|
|
|
|
$scope.modifySubMerchantId = function (subMerchantId, channel) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/md_sub_merchant_id.html',
|
|
|
|
|
controller: 'ModifysubMerchantIdCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
clientMoniker: function () {
|
|
|
|
|
return $scope.partner.client_moniker
|
|
|
|
|
},
|
|
|
|
|
merchantId: function () {
|
|
|
|
|
return subMerchantId
|
|
|
|
|
},
|
|
|
|
|
channel: function () {
|
|
|
|
|
return channel
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).result.then(function () {
|
|
|
|
|
$scope.loadPartnerInfo()
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.showMoreMerchantInfo = false;
|
|
|
|
|
$scope.hideMerchantInfo = function () {
|
|
|
|
|
$scope.showMoreMerchantInfo = !$scope.showMoreMerchantInfo;
|
|
|
|
@ -5300,18 +5638,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.partner.cardInfo = resp.data;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.useSubMerchantId = function (sub_merchant_id) {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
content: 'Modify Wechat Sub Merchant ID successfully',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
$state.reload();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$scope.updateSubMerchantId = function (merchant_app_id) {
|
|
|
|
|
$uibModal.open({
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html',
|
|
|
|
@ -5512,6 +5838,42 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
// 展示信息
|
|
|
|
|
app.controller('subMerchantDetailCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', 'subMerchantInfo', 'channel', function ($scope, $http, $uibModal, $state, commonDialog, subMerchantInfo, channel) {
|
|
|
|
|
$scope.channel = channel
|
|
|
|
|
$scope.subMerchantInfo = subMerchantInfo
|
|
|
|
|
}]);
|
|
|
|
|
// 修改sub_merchant_id
|
|
|
|
|
app.controller('ModifysubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'commonDialog', 'clientMoniker', 'merchantId', 'channel', function ($scope, $http, $uibModal, $state, commonDialog, clientMoniker, merchantId, channel) {
|
|
|
|
|
console.log(merchantId, channel);
|
|
|
|
|
$scope.merchantId = merchantId
|
|
|
|
|
$scope.flag = false
|
|
|
|
|
$scope.confirm = function () {
|
|
|
|
|
$scope.flag = true
|
|
|
|
|
if (channel === 'Wechat') {
|
|
|
|
|
$http.put('/sys/partners/' + clientMoniker + '/payment_config', { sub_merchant_id: merchantId }).then(function (resp) {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.flag = false
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
} else if (channel === 'Alipay') {
|
|
|
|
|
$http.put('/sys/partners/' + clientMoniker + '/ali_sub_merchant_id', { ali_sub_merchant_id: merchantId }).then(function (resp) {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.flag = false
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
} else if (channel = 'AlipayOnline') {
|
|
|
|
|
$http.put('/sys/partners/' + clientMoniker + '/ali_sub_merchant_id', { ali_sub_merchant_id: merchantId }).then(function (resp) {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
$scope.flag = false
|
|
|
|
|
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('newApplyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', 'wechatGoodMcc', 'businessTypesMap', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog, wechatGoodMcc, businessTypesMap) {
|
|
|
|
|
$scope.wxIndustries = angular.copy(wxMerchantIndustries);
|
|
|
|
|
$scope.subMerchantInfo = angular.copy(subMerchantInfo);
|
|
|
|
@ -5540,11 +5902,41 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.subMerchantInfo.mcc_code = $scope.subMerchantInfo.mc_code;
|
|
|
|
|
}
|
|
|
|
|
if (subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date = new Date(datestr);
|
|
|
|
|
}
|
|
|
|
|
if($scope.subMerchantInfo.business_structure ){
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure == 'Company'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure != 'Registered body(Sole Trader)'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
}
|
|
|
|
|
if(subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
if(subMerchantInfo.certificat_expire_date=="PERMANENT"){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=true;
|
|
|
|
|
}else if(subMerchantInfo.certificat_expire_date=="N/A"){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=true;
|
|
|
|
|
}else {
|
|
|
|
|
var datestr = subMerchantInfo.certificat_expire_date.replace(/-/g, '/');
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d = new Date(datestr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.checkExpriedate=function (value) {
|
|
|
|
|
if(value){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.checkExpriedateOther=function (value) {
|
|
|
|
|
if(value=='PERMANENT'){
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_premanent){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_NA=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}else if(value=='N/A'){
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_NA){
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_premanent=false;
|
|
|
|
|
$scope.subMerchantInfo.certificat_expire_date_d=null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.saveAppliy = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
@ -5585,8 +5977,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
params.director_id_number = $scope.subMerchantInfo.director_id_number;
|
|
|
|
|
params.company_register_no = $scope.subMerchantInfo.company_register_no;
|
|
|
|
|
params.certificat_expire_date = $scope.subMerchantInfo.certificat_expire_date;
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date) {
|
|
|
|
|
params.certificat_expire_date = $filter('dateConversionStr')($scope.subMerchantInfo.certificat_expire_date)
|
|
|
|
|
|
|
|
|
|
if($scope.subMerchantInfo.certificat_expire_date_d) {
|
|
|
|
|
params.certificat_expire_date = $filter('dateConversionStr')($scope.subMerchantInfo.certificat_expire_date_d)
|
|
|
|
|
}else if($scope.subMerchantInfo.certificat_expire_date_premanent){
|
|
|
|
|
params.certificat_expire_date="PERMANENT";
|
|
|
|
|
}
|
|
|
|
|
else if($scope.subMerchantInfo.certificat_expire_date_NA){
|
|
|
|
|
params.certificat_expire_date="N/A";
|
|
|
|
|
}else{
|
|
|
|
|
alert("Certificate expiration time is required");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
params.principal_name = $scope.subMerchantInfo.principal_name;
|
|
|
|
@ -5635,7 +6036,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.businessTypesMap=businessTypesMap.configs();
|
|
|
|
|
|
|
|
|
|
if($scope.subMerchantInfo.business_structure ){
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure == 'Company'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
$scope.subMerchantInfo.merchant_type=$scope.subMerchantInfo.business_structure != 'Registered body(Sole Trader)'? "ENTERPRISE":"INDIVIDUAL";
|
|
|
|
|
}
|
|
|
|
|
if($scope.subMerchantInfo.industry) {
|
|
|
|
|
$scope.subMerchantInfo.industry = $filter('newWxMerchantsFilter')($scope.subMerchantInfo.industry);
|
|
|
|
|