diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 260e34b30..3bb6f6056 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -175,7 +175,7 @@ public class PartnerManageController { clientManager.setClientRetailPaySurCharge(clientMoniker, config.getBooleanValue("retail_surcharge")); } - @ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) + @ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public void setClientTaxPayer(@PathVariable String clientMoniker, @RequestBody JSONObject config) { clientManager.setClientTaxInSurcharge(clientMoniker, config.getBooleanValue("tax_in_surcharge")); } diff --git a/src/main/ui/static/templates/alipay/v1/payment.js b/src/main/ui/static/templates/alipay/v1/payment.js index d37f6b1a1..dace0a34c 100644 --- a/src/main/ui/static/templates/alipay/v1/payment.js +++ b/src/main/ui/static/templates/alipay/v1/payment.js @@ -100,9 +100,11 @@ $(function () { dataCache.discounts = []; dataCache.tax = surchargeData.tax; dataCache.surcharge = surchargeData.surcharge; + $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); var rate = 'CNY' == window.currency ? 1 : exchangeRate; var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); @@ -201,11 +203,8 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); - if (parseFloat(dataCache.surcharge) > 0) { - $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd); - } - if (parseFloat(dataCache.tax) > 0) { - $('

').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); diff --git a/src/main/ui/static/templates/bestpay/v1/app_pay_2.js b/src/main/ui/static/templates/bestpay/v1/app_pay_2.js index 584cbb174..fefdcd59e 100644 --- a/src/main/ui/static/templates/bestpay/v1/app_pay_2.js +++ b/src/main/ui/static/templates/bestpay/v1/app_pay_2.js @@ -92,6 +92,7 @@ $(function () { $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); var rate = 'CNY' == window.currency ? 1 : exchangeRate; var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); @@ -190,11 +191,8 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); - if (parseFloat(dataCache.surcharge) > 0) { - $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd); - } - if (parseFloat(dataCache.tax) > 0) { - $('

').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd);