lessInfoMerchant = new ArrayList<>();
+ for (String clientMoniker : partner) {
+ JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
+ if (client == null) {
+ continue;
+ }
+ try {
+ needRegisterMerchant.add(client.getString("client_moniker"));
+ if (StringUtils.isBlank(client.getString("alipayindustry"))) {
+ client.put("alipayindustry", "5311");
+ }
+ if (StringUtils.isBlank(client.getString("business_structure"))) {
+ client.put("business_structure", "da");
+ }
+ if (StringUtils.isBlank(client.getString("store_photo")) || StringUtils.isBlank(client.getString("company_photo"))) {
+ if (StringUtils.isBlank(client.getString("store_photo")) && !StringUtils.isBlank(client.getString("company_photo"))) {
+ client.put("store_photo", client.getString("company_photo"));
+ }
+ if (!StringUtils.isBlank(client.getString("store_photo")) && StringUtils.isBlank(client.getString("company_photo"))) {
+ client.put("company_photo", client.getString("store_photo"));
+ }
+ if (StringUtils.isBlank(client.getString("store_photo")) && StringUtils.isBlank(client.getString("company_photo"))) {
+ client.put("store_photo", client.getString("logo_url"));
+ client.put("company_photo", client.getString("logo_url"));
+ }
+ }
+ checkPartnerInfo(client,"offline");
+ } catch (InvalidParameterException e) {
+ JSONObject exception = new JSONObject();
+ exception.put("client_moniker", client.getString("client_moniker"));
+ exception.put("return_msg", e.getMessage());
+ exception.put("bd_name", client.getString("bd_user_name"));
+ lessInfoMerchant.add(exception);
+ continue;
+ }
+ AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant();
+ Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client);
+ if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) {
+ JSONObject exception = new JSONObject();
+ exception.put("client_moniker", client.getString("client_moniker"));
+ exception.put("return_msg", resultElement.elementText("error"));
+ registerFailMerchant.add(exception);
+ continue;
+ }
+ Element responseElement = resultElement.element("response").element("alipay");
+ if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) {
+ JSONObject exception = new JSONObject();
+ exception.put("client_moniker", client.getString("client_moniker"));
+ exception.put("return_msg", resultElement.elementText("error"));
+ registerFailMerchant.add(exception);
+ continue;
+ }
+ registerSuccessMerchant.add(client.getString("client_moniker"));
+ }
+ result.put("need_register_merchant", needRegisterMerchant);
+ result.put("success_register_merchant", registerSuccessMerchant);
+ result.put("fail_register_merchant", registerFailMerchant);
+ result.put("less_info_merchant", lessInfoMerchant);
+ return result;
+ }
+
@Override
public JSONObject getLessPartnerInfo() {
JSONObject result = new JSONObject();
diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java
index dad9bb3be..13418cd84 100644
--- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java
+++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java
@@ -464,6 +464,11 @@ public class TestController implements ApplicationEventPublisherAware {
return aliforexcelService.registerAlipayMerchant();
}
+ @ManagerMapping(value = "/register/alipayGms/insert_partner", role = ManagerRole.DEVELOPER, method = RequestMethod.POST)
+ public JSONObject registerInsertAlipayMerchant(@RequestBody JSONObject partners) {
+ return aliforexcelService.registerInsertAlipayMerchant(partners.getString("partners"));
+ }
+
@ManagerMapping(value = "/register/getLessPartnerInfo", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
public JSONObject getLessPartnerInfo() {
return aliforexcelService.getLessPartnerInfo();
diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js
index 2cc56f2bb..a97576c01 100644
--- a/src/main/ui/static/config/devtools/devtools.js
+++ b/src/main/ui/static/config/devtools/devtools.js
@@ -439,6 +439,23 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
alert(resp.data.message);
})
};
+ $scope.registerInsertGMS = function (text) {
+ $scope.totalhide = true;
+ $scope.selecttotal = false;
+ var params = {};
+ params.partners = text;
+ $http.post('/dev/register/alipayGms/insert_partner',params).then(function (resp) {
+ $scope.totalhide = false;
+ $scope.selecttotal = true;
+ $scope.need_register_merchant = resp.data.need_register_merchant.toString();
+ $scope.success_register_merchant = resp.data.success_register_merchant.toString();
+ $scope.fail_register_merchant = resp.data.fail_register_merchant;
+ $scope.less_info_merchant = resp.data.less_info_merchant();
+ }, function (resp) {
+ alert(resp.data.message);
+ })
+ };
+
$scope.getLessPartnerInfo = function () {
$scope.totalhide = true;
$scope.selecttotal = false;
diff --git a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html
index eef722aa4..12a73e0d6 100644
--- a/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html
+++ b/src/main/ui/static/config/devtools/templates/registerAlipayOnlineMerchant.html
@@ -18,6 +18,10 @@
+
+
+
+