add alipay online gms 等待回应 temp commit

master
luoyang 6 years ago
parent c0d7c20fe2
commit 73d7447603

@ -2,12 +2,12 @@ package au.com.royalpay.payment.manage.dev.web;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.support.wechatclients.RedpackWechatApiImpl;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.globalfreepay.payment.tools.CommonConsts;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -315,8 +315,12 @@ public interface ClientManager {
void registerAlipayGms(String clientMoniker, String representative_id, JSONObject manager);
void registerAlipayOnlineGms(String clientMoniker, String representative_id, JSONObject manager);
String queryAlipayGmsStatus(String clientMoniker, JSONObject manager);
String queryAlipayOnlineGmsStatus(String clientMoniker, JSONObject manager);
List<JSONObject> listMerchantIds(String clientMoniker,JSONObject manager);
void clearCacheSubMerchantIdApplices(String clientMoniker);

@ -3726,6 +3726,58 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return responseElement.elementText("secondary_merchant_id") + " - status : " + responseElement.elementText("status");
}
@Override
public void registerAlipayOnlineGms(String clientMoniker, String representative_id, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
if (!client.containsKey("company_website")) {
throw new InvalidParameterException("Website 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 (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().getAlipayOnlineMerchant();
Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client);
if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
throw new BadRequestException(resultElement.elementText("error"));
}
try {
Element responseElement = resultElement.element("response").element("alipay");
if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
throw new BadRequestException(responseElement.elementText("result_code"));
}
} catch (Exception e) {
throw new ServerErrorException(e);
}
}
@Override
public String queryAlipayOnlineGmsStatus(String clientMoniker, JSONObject manager) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkOrgPermission(manager, client);
AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant();
Element resultElement = alipayClient.queryOnlineGmsPortalStatus(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);

@ -576,6 +576,16 @@ public class PartnerManageController {
return clientManager.queryAlipayGmsStatus(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/register/alipayOnline_gms", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public void registerAlipayOnlineGms(@PathVariable String clientMoniker,@RequestBody String representative_id,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.registerAlipayOnlineGms(clientMoniker, representative_id, manager);
}
@ManagerMapping(value = "/{clientMoniker}/query/alipayOnline_gms", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN})
public String queryAlipayOnlineGmsStatus(@PathVariable String clientMoniker,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.queryAlipayOnlineGmsStatus(clientMoniker, manager);
}
@ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN})
public List<JSONObject> getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.listMerchantIds(clientMoniker,manager);

@ -1529,6 +1529,33 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
})
})
}
$scope.submitAlipayOnlineSubId = function () {
commonDialog.confirm({
title: 'Warning',
content: '是否使用该商户的现有信息进件?'
}).then(function () {
commonDialog.inputText({title: '请输入商户身份证或护照号码'}).then(function (text) {
$http.post('/sys/partners/' + $scope.partner.client_moniker + '/register/alipayOnline_gms',{representative_id:text}).then(function () {
commonDialog.alert({title: 'Success', content: 'AlipayOnline进件成功', type: 'success'});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
});
})
};
$scope.queryAlipayOnlineGms = function () {
commonDialog.confirm({
title: 'Warning',
content: '是否查询该商户报备状态?'
}).then(function () {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/query/alipayOnline_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',

@ -73,6 +73,10 @@
<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>
|
<a role="button" ng-click="submitAlipayOnlineSubId()"><i class="fa fa-arrow-up" title="AlipayOnline进件"></i></a>
<a role="button" ng-click="queryAlipayOnlineGms()"><i class="fa fa-refresh" title="AlipayOnline进件"></i></a>
(AlipayOnline)
</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