add alipay 报备

master
luoyang 6 years ago
parent e3016f1025
commit c0d7c20fe2

@ -313,7 +313,9 @@ public interface ClientManager {
String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager);
void registerAlipayGms(String clientMoniker,JSONObject manager);
void registerAlipayGms(String clientMoniker, String representative_id, JSONObject manager);
String queryAlipayGmsStatus(String clientMoniker, JSONObject manager);
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);

@ -3673,7 +3673,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void registerAlipayGms(String clientMoniker, JSONObject manager) {
public void registerAlipayGms(String clientMoniker, String representative_id, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -3682,6 +3682,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (!client.containsKey("store_photo") || !client.containsKey("company_photo")) {
throw new InvalidParameterException("store photo cannot be empty ");
}
JSONObject client_bank = getBankAccountByClientId(client.getIntValue("client_id"));
if (client_bank == null || client_bank.size() <= 0) {
throw new BadRequestException("The Partner's Account is not config!");
}
client.put("bank_id", client_bank.getString("account_no"));
if (!"Company".equals(client.getString("business_structure"))) {
if (representative_id == null || representative_id.isEmpty()) {
throw new BadRequestException("ID or passport number can't be null");
}
client.put("representative_id", representative_id);
}
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
@ -3697,6 +3710,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
public String queryAlipayGmsStatus(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
Element resultElement = alipayClient.queryGmsPortalStatus(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
return resultElement.elementText("error");
}
Element responseElement = resultElement.element("response").element("alipay");
return responseElement.elementText("secondary_merchant_id") + " - status : " + responseElement.elementText("status");
}
@Override
public void subRpayMerchantApplication(String clientMoniker, JSONObject merchantInfo,JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -567,8 +567,13 @@ public class PartnerManageController {
}
@ManagerMapping(value = "/{clientMoniker}/register/alipay_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void registerAlipayGms(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayGms(clientMoniker,manager);
public void registerAlipayGms(@PathVariable String clientMoniker,@RequestBody String representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayGms(clientMoniker, representative_id, manager);
}
@ManagerMapping(value = "/{clientMoniker}/query/alipay_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public String queryAlipayGmsStatus(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.queryAlipayGmsStatus(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})

@ -1500,13 +1500,35 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
title: 'Warning',
content: '是否使用该商户的现有信息进件?'
}).then(function () {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms').then(function () {
if ($scope.partner.business_structure == "Company"){
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms',{representative_id:""}).then(function () {
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}else {
commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipay_gms',{representative_id:text}).then(function () {
commonDialog.alert({title: 'Success', content: 'Alipay进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
});
}
})
};
$scope.queryAlipayGms = function () {
commonDialog.confirm({
title: 'Warning',
content: '是否查询该商户报备状态?'
}).then(function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipay_gms').then(function (resp) {
commonDialog.alert({title: 'Success', content: resp.data, type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
}
$scope.refreshCredential = function () {
commonDialog.confirm({
title: 'Warning',

@ -72,6 +72,7 @@
{{paymentInfo.ali_sub_merchant_id||'Not Configure'}}
<a role="button" ng-click="ctrl.editAliSubMerchant=true" ng-if="'10'|withRole"><i class="fa fa-edit"></i></a>
<a role="button" ng-click="submitAlipaySubId()"><i class="fa fa-arrow-up" title="Alipay进件"></i></a>
<a role="button" ng-click="queryAlipayGms()"><i class="fa fa-refresh" title="Alipay进件"></i></a>
</p>
<div class="input-group" ng-if="ctrl.editAliSubMerchant">
<input type="text" class="form-control" ng-model="paymentInfo.ali_sub_merchant_id"

Loading…
Cancel
Save