diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java index e6d7d0dbe..e7764f981 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientRegisterInfo.java @@ -3,7 +3,6 @@ package au.com.royalpay.payment.manage.merchants.beans; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; -import org.apache.commons.lang3.StringUtils; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; @@ -115,8 +114,6 @@ public class ClientRegisterInfo { private String client_pay_desc; @JSONField(name = "it_contact_person_email") private String itContactPersonEmail; - @JSONField(name = "client_type") - private String clientType; @JSONField(name = "acceptor_name") private String acceptorName; @JSONField(name = "expected_card_revenue") @@ -127,7 +124,10 @@ public class ClientRegisterInfo { private String mwIndustry; @JSONField(name = "enable_international_card") private boolean enableInternaltionCard; - + @JSONField(name = "enable_cross_payment") + private boolean enableCrossPayment; + @JSONField(name = "enable_card_payment") + private boolean enableCardPayment; public JSONObject insertObject() { if (industry == null) { @@ -140,10 +140,6 @@ public class ClientRegisterInfo { return res; } - public boolean enableCardPayment() { - return StringUtils.equalsIgnoreCase("card-payment", clientType) || StringUtils.equalsIgnoreCase("all", clientType); - } - public JSONObject updateObject() { JSONObject obj = insertObject(); obj.remove("client_moniker"); @@ -622,11 +618,19 @@ public class ClientRegisterInfo { this.mwIndustry = mwIndustry; } - public String getClientType() { - return clientType; + public boolean isEnableCardPayment() { + return enableCardPayment; + } + + public boolean isEnableCrossPayment() { + return enableCrossPayment; + } + + public void setEnableCardPayment(boolean enableCardPayment) { + this.enableCardPayment = enableCardPayment; } - public void setClientType(String clientType) { - this.clientType = clientType; + public void setEnableCrossPayment(boolean enableCrossPayment) { + this.enableCrossPayment = enableCrossPayment; } } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 6b667a1ad..05ec8fbfa 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -834,11 +834,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientConfig.put("client_moniker", partner.getString("client_moniker")); clientConfig.put("client_pay_type", partner.getString("client_pay_type")); clientConfig.put("client_pay_desc", partner.get("client_pay_desc")); + clientConfig.put("enable_cross_payment", partner.get("enable_cross_payment")); + clientConfig.put("enable_card_payment", partner.get("enable_card_payment")); clientConfigService.save(clientConfig); permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker")); saveLegalAndMarketingInfo(partner); - if (registery.enableCardPayment()) { + if (registery.isEnableCardPayment()) { sysClientUpayProfileMapper.save(partner); } } catch (Exception e) { @@ -917,7 +919,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid sysClientLegalPersonMapper.save(representativeInfo); } - if (info.enableCardPayment()) { + if (info.isEnableCardPayment()) { JSONObject upay = sysClientUpayProfileMapper.findInfo(clientId); if (upay == null) { sysClientUpayProfileMapper.save(updateInfo); @@ -942,6 +944,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid JSONObject clientConfig = new JSONObject(); clientConfig.put("client_id", clientId); clientConfig.put("client_moniker", client.getString("client_moniker")); + clientConfig.put("enable_cross_payment", updateInfo.getBooleanValue("enable_cross_payment")); + clientConfig.put("enable_card_payment", updateInfo.getBooleanValue("enable_card_payment")); if (StringUtils.isNotBlank(updateInfo.getString("client_pay_type")) && StringUtils.isNotBlank(updateInfo.getString("client_pay_desc"))) { clientConfig.put("client_pay_type", updateInfo.getString("client_pay_type")); clientConfig.put("client_pay_desc", updateInfo.getString("client_pay_desc")); diff --git a/src/main/ui/static/payment/partner/add-partner.js b/src/main/ui/static/payment/partner/add-partner.js index 8f2e8ae34..821e49bd0 100644 --- a/src/main/ui/static/payment/partner/add-partner.js +++ b/src/main/ui/static/payment/partner/add-partner.js @@ -38,7 +38,8 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } else { $scope.partner = {timezone: 'Australia/Melbourne'}; } - $scope.partner.client_type = 'cross-border'; + $scope.partner.enable_cross_payment = true; + $scope.partner.enable_cross_payment = false; $scope.initMerchantCode = function () { $http.get('/sys/partners/init/merchant_code').then(function (response) { $scope.partner.client_moniker = response.data.partner_code; @@ -61,6 +62,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } }; $scope.partner.sameAsContactPerson = false; + + $scope.enablePaymentType = function (type) { + $scope.partner[type] = !$scope.partner[type]; + }; $scope.checkboxOnclick = function (){ $scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson); if($scope.partner.sameAsContactPerson) { @@ -490,6 +495,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.partner.marketing_wechatid = $scope.partner.representativeInfo.marketing_wechatid; } + $scope.enablePaymentType = function (type) { + $scope.partner[type] = !$scope.partner[type]; + }; + function hasRole() { var rolenum; switch (sessionStorage.getItem('role')) { diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 8cdacf735..45deacc9b 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -40,14 +40,11 @@
@@ -149,7 +146,7 @@
-
@@ -166,7 +163,7 @@
-
@@ -188,7 +185,7 @@
-
@@ -218,8 +215,8 @@
- + ng-if="partner.business_structure != 'Company' || partner.enable_card_payment"> +
+ ng-if="partner.business_structure == 'Company' && partner.enable_cross_payment">
线上 -
-
+
@@ -421,7 +418,7 @@
-
+
@@ -492,7 +489,7 @@
-
+
1:  @@ -524,7 +521,7 @@
-
@@ -540,7 +537,7 @@
-
@@ -560,7 +557,7 @@
-
+
Alipay Information  (Optional)
@@ -744,7 +741,7 @@
-
+
@@ -869,9 +866,9 @@
-
-
  Marketing Person
-
+
+
  Marketing Person
+
@@ -1251,7 +1248,7 @@
-
@@ -1270,7 +1267,7 @@
-
@@ -1290,7 +1287,7 @@
-
@@ -1308,7 +1305,7 @@
-
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index b525a376f..b2bd550f7 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -36,14 +36,11 @@
-
@@ -182,7 +179,7 @@
-
@@ -201,7 +198,7 @@
-
@@ -218,7 +215,7 @@
-
@@ -341,7 +338,7 @@ ng-click="toggleClientPayType('1')"> 线上 -
-
+
@@ -408,7 +405,7 @@
-
+
@@ -479,7 +476,7 @@
-
+
1:  @@ -510,7 +507,7 @@
-
@@ -526,7 +523,7 @@
-
@@ -546,7 +543,7 @@
-
+
Alipay Information   (Optional)
@@ -671,7 +668,7 @@
-
+
@@ -783,8 +780,8 @@
-
  Marketing Person
-
+
  Marketing Person
+
@@ -1157,7 +1154,7 @@
-
@@ -1176,7 +1173,7 @@
-
@@ -1195,7 +1192,7 @@
-
@@ -1213,7 +1210,7 @@
-
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index 6d9aff34c..05445da42 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -205,36 +205,12 @@
-
- -
- -
-
-
- -
- -
-
-