Rate Name |
- Rate Value |
+ Rate Value |
+ Domestic Rate Value |
+ International Rate Value |
+ Transaction Fee |
Active Time |
Expire Time |
- Clean Days |
+ Clean Days |
Remark |
|
- |
+ |
+ |
+ |
+ |
|
|
- T+{{rate.clean_days}} |
+ T+{{rate.clean_days}} |
|
diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html
index 8a88b7b27..81a134cc8 100644
--- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html
+++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html
@@ -212,17 +212,24 @@
Rpay+
CB_BankPay
+ Card Payment
+ Direct Debit
+
Rate Name |
- Rate Value |
+ Rate Value |
+ Domestic Rate Value |
+ International Rate Value |
Transaction Fee |
Active Time |
Expire Time |
- Clean Days |
+ Clean Days |
Update Time |
Operator |
Remark |
@@ -233,11 +240,13 @@
|
- |
+ |
+ |
+ |
|
|
|
- T+{{rate.clean_days}} |
+ T+{{rate.clean_days}} |
|
|
|
diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html
index 934bdd78c..220dc763a 100644
--- a/src/main/ui/static/payment/partner/templates/partner_detail.html
+++ b/src/main/ui/static/payment/partner/templates/partner_detail.html
@@ -277,6 +277,9 @@
Compliance Files
+
+ Merchant Warrior Compliance Files
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html b/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html
new file mode 100644
index 000000000..079916613
--- /dev/null
+++ b/src/main/ui/static/payment/partner/templates/partner_mw_auth_files.html
@@ -0,0 +1,194 @@
+
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_new_card_payment_rate.html b/src/main/ui/static/payment/partner/templates/partner_new_card_payment_rate.html
new file mode 100644
index 000000000..18f5807c8
--- /dev/null
+++ b/src/main/ui/static/payment/partner/templates/partner_new_card_payment_rate.html
@@ -0,0 +1,147 @@
+
+
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html
index eddcdbc13..70dd618a8 100644
--- a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html
+++ b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html
@@ -154,7 +154,11 @@
Yeepay |
LakalaPay
+ ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay |
+ Card Payment |
+ Direct Debit
@@ -357,6 +361,8 @@
|
+
+
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 c42607419..80df579ba 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
@@ -242,6 +242,19 @@
+
+
+
@@ -591,6 +604,16 @@
switch-change="toggleRequireRemark()">
+
diff --git a/src/main/ui/static/payment/partner/templates/rate_config_dialog.html b/src/main/ui/static/payment/partner/templates/rate_config_dialog.html
index d95950528..5c916e182 100644
--- a/src/main/ui/static/payment/partner/templates/rate_config_dialog.html
+++ b/src/main/ui/static/payment/partner/templates/rate_config_dialog.html
@@ -14,7 +14,9 @@
+
-
-
-
No less than 0
@@ -78,7 +97,9 @@
datepicker-options="{minDate:rate.active_time}">
-
@@ -384,6 +388,10 @@
uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
+
+
{{trade.order_id}}
|
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html
index 8d8e063e0..4a78f5a94 100644
--- a/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html
+++ b/src/main/ui/static/payment/tradelog/templates/partner_incremental_trade_logs.html
@@ -146,7 +146,11 @@
Yeepay |
LakalaPay
+ ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay |
+ Card Payment |
+ Direct Debit
@@ -341,6 +345,8 @@
+
+
{{trade.order_id}}
|
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_trade_detail_edit.html b/src/main/ui/static/payment/tradelog/templates/partner_trade_detail_edit.html
index d91c3e058..16d03d7ba 100644
--- a/src/main/ui/static/payment/tradelog/templates/partner_trade_detail_edit.html
+++ b/src/main/ui/static/payment/tradelog/templates/partner_trade_detail_edit.html
@@ -1,3 +1,11 @@
+
+
@@ -140,6 +148,19 @@
+
+
@@ -191,4 +212,4 @@
|
-
\ No newline at end of file
+
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html
index 7b5a7d028..b715730be 100644
--- a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html
+++ b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html
@@ -219,7 +219,11 @@
Yeepay |
LakalaPay
+ ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay |
+ Card Payment |
+ Direct Debit
@@ -641,6 +645,10 @@
ng-if="trade.channel=='Yeepay'"/>
+
+
{{trade.order_id}}
diff --git a/src/main/ui/static/payment/tradelog/templates/trade_logs.html b/src/main/ui/static/payment/tradelog/templates/trade_logs.html
index e22dea465..714798fa0 100644
--- a/src/main/ui/static/payment/tradelog/templates/trade_logs.html
+++ b/src/main/ui/static/payment/tradelog/templates/trade_logs.html
@@ -203,7 +203,11 @@
Yeepay |
LakalaPay
+ ng-click="params.channel='LAKALAPAY';loadTradeLogs(1)">LakalaPay |
+ Card Payment |
+ Direct Debit
@@ -486,6 +490,10 @@
uib-tooltip="Yeepay" ng-if="trade.channel=='Yeepay'"/>
+
+
{{trade.order_id}}
diff --git a/src/main/ui/static/templates/billCode/css/billCode_mobile.css b/src/main/ui/static/templates/billCode/css/billCode_mobile.css
new file mode 100644
index 000000000..5a8457836
--- /dev/null
+++ b/src/main/ui/static/templates/billCode/css/billCode_mobile.css
@@ -0,0 +1,47 @@
+.commit-button{
+ width: 100%;
+ border-radius: 25px;
+ background-color: #ED2424;
+ color: #FFFFFF;
+ font-size: 16px;
+ line-height: 40px;
+ border: 0px;
+ margin-top: 20px;
+}
+
+label{
+ color: #9B9B9B;
+ margin-bottom: 0px;
+}
+
+.bill-info-right{
+ float: right;
+}
+
+.margin-body{
+ margin: 15px
+}
+
+.row-line-height{
+ height: 20px;
+ margin: 15px 0px 15px -15px;
+}
+
+.row-line-height-plus{
+ height: 60px;
+ line-height: 60px;
+}
+
+.border-top-line{
+ border-top: 1px solid #EEEEEE
+}
+
+.border-button-line{
+ border-bottom: 1px solid #EEEEEE;
+
+}
+
+#timer{
+ font-weight: 600;
+ color: #ED2424;
+}
\ No newline at end of file
diff --git a/src/main/ui/static/templates/billCode/css/billCode_pc.css b/src/main/ui/static/templates/billCode/css/billCode_pc.css
new file mode 100644
index 000000000..c60ee8d0e
--- /dev/null
+++ b/src/main/ui/static/templates/billCode/css/billCode_pc.css
@@ -0,0 +1,129 @@
+body{
+ padding: 3% 10%;
+ width: 100%;
+ height: 100%;
+ margin: 0;
+}
+
+.head{
+ padding-bottom: 20px;
+ border-bottom: 2px solid #DCDCDC;
+}
+
+.pc-cash{
+ font-size: 28px;
+ position: absolute;
+ margin: 15px;
+}
+
+.order-box{
+ text-align: center;
+}
+
+.count-down{
+ text-align: center;
+ font-size: 20px;
+ margin: 20px;
+ line-height: 97px;
+ background-color: #FEF4F4;
+}
+
+label{
+ color: #ED2424;
+ font-size: 20px;
+ margin-bottom: 0px;
+}
+
+.bill-info-right{
+ float: right;
+ font-size: 20px;
+ font-weight: 800;
+}
+
+.margin-body{
+ margin: 15px
+}
+
+.row-line-height{
+ height: 20px;
+ margin: 15px 0px 15px -15px;
+}
+
+.row-line-height-plus{
+ height: 60px;
+ line-height: 60px;
+}
+
+.border-top-line{
+ border-top: 1px solid #EEEEEE
+}
+
+.border-button-line{
+ border-bottom: 1px solid #EEEEEE;
+ padding: 20px 5px;
+}
+
+#timer{
+ font-weight: 600;
+ color: #ED2424;
+}
+
+.info-body{
+ background-color: #FEF4F4;
+ height: 650px;
+ margin-top: 20px;
+ border-radius: 10px 10px 0px 0px;
+}
+.info-body-title{
+ background: #ED2424;
+ line-height: 50px;
+ font-size: 25px;
+ color: #FFF;
+ border-radius: 10px 10px 0px 0px;
+}
+
+.pay-fun{
+ font-family: PingFang-SC-Bold;
+ font-size: 20px;
+ color: #ED2424;
+ font-weight: 600;
+ margin: 50px;
+}
+
+#commit-btn{
+ width: 30%;
+ border-radius: 5px;
+ background-color: #ED2424;
+ color: #FFFFFF;
+ font-size: 16px;
+ line-height: 40px;
+ border: 0px;
+ margin: 100px 0px;
+ text-align: center;
+}
+
+.select-pay-fun{
+ text-align: center;
+ width: 80%;
+ height: 120% ;
+ border: 1px solid #ED2424;
+ padding: 10px 0px;
+ margin-top: 5px;
+}
+
+.no-select-pay-fun{
+ text-align: center;
+ width: 80%;
+ height: 120% ;
+ border: 1px solid #EAEAEA;
+ padding: 10px 0px;
+ margin: 5px 0px 5px 0px;
+}
+
+#qrImg{
+ margin-top: 40px;
+}
+
+.img-size{
+ height: 58px;
+}
\ No newline at end of file
diff --git a/src/main/ui/static/templates/billCode/img/bill_alipay.png b/src/main/ui/static/templates/billCode/img/bill_alipay.png
new file mode 100644
index 000000000..66153aadc
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_alipay.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_big_alipay.png b/src/main/ui/static/templates/billCode/img/bill_big_alipay.png
new file mode 100644
index 000000000..42047f40e
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_big_alipay.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_big_cb_bank.png b/src/main/ui/static/templates/billCode/img/bill_big_cb_bank.png
new file mode 100644
index 000000000..f674191a6
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_big_cb_bank.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_big_wechat.png b/src/main/ui/static/templates/billCode/img/bill_big_wechat.png
new file mode 100644
index 000000000..a8b98a302
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_big_wechat.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_cb_bank.png b/src/main/ui/static/templates/billCode/img/bill_cb_bank.png
new file mode 100644
index 000000000..27a35be0b
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_cb_bank.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_select.png b/src/main/ui/static/templates/billCode/img/bill_select.png
new file mode 100644
index 000000000..ab6822321
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_select.png differ
diff --git a/src/main/ui/static/templates/billCode/img/bill_wechat.png b/src/main/ui/static/templates/billCode/img/bill_wechat.png
new file mode 100644
index 000000000..0f1e04f18
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/bill_wechat.png differ
diff --git a/src/main/ui/static/templates/billCode/img/create_success.png b/src/main/ui/static/templates/billCode/img/create_success.png
new file mode 100644
index 000000000..210bdc3f7
Binary files /dev/null and b/src/main/ui/static/templates/billCode/img/create_success.png differ
diff --git a/src/main/ui/static/templates/billCode/img/logo.png b/src/main/ui/static/templates/billCode/img/logo.png
new file mode 100644
index 000000000..47ef054cd
--- /dev/null
+++ b/src/main/ui/static/templates/billCode/img/logo.png
@@ -0,0 +1,58 @@
+
+
+
+
diff --git a/src/main/ui/static/templates/billCode/js/mobile_payment.js b/src/main/ui/static/templates/billCode/js/mobile_payment.js
new file mode 100644
index 000000000..7a61910a8
--- /dev/null
+++ b/src/main/ui/static/templates/billCode/js/mobile_payment.js
@@ -0,0 +1,252 @@
+/**
+ * Created by dulingling on 2020-03-25.
+ */
+$(document).ready(function () {
+ var paymentFun = '';
+ var selectPaymentHTML = " ";
+ var maxtime = window.maxtime;
+ var hasPayment =true;//可支付
+
+ if(window.openmobilefun == 'wechat'|| window.openmobilefun == 'other'){
+ paymentFun = 'Wechat'
+ }else{
+ paymentFun = 'Alipay'
+ $(".select_wechat").empty();
+ $(".select_alipay").append(selectPaymentHTML);
+ $(".select_bank").empty();
+ }
+
+ setInterval(function(){
+ if(maxtime>0){
+ var countdown=document.getElementById("timer");
+ maxtime=maxtime-1;
+ var minute=parseInt(maxtime/60);
+ var second=parseInt(maxtime%60);
+ countdown.innerHTML=minute+'分'+second+'秒';
+ }else{
+ $('#commit-btn').css({"background-color":"#eee",});
+ hasPayment = false;
+ }
+ },1000);
+
+
+ $("#select_wechat").click(function(){
+ if(paymentFun != 'Wechat'){
+ paymentFun = 'Wechat'
+ $(".select_wechat").append(selectPaymentHTML);
+ $(".select_alipay").empty();
+ $(".select_bank").empty();
+ }
+ })
+ $("#select_alipay").click(function(){
+ if(paymentFun != 'Alipay'){
+ paymentFun = 'Alipay'
+ $(".select_wechat").empty();
+ $(".select_alipay").append(selectPaymentHTML);
+ $(".select_bank").empty();
+ }
+ })
+ $("#select_bank").click(function(){
+ if(paymentFun != 'Bank'){
+ paymentFun = 'Bank'
+ $(".select_wechat").empty();
+ $(".select_alipay").empty();
+ $(".select_bank").append(selectPaymentHTML);
+ }
+ })
+
+ $("#commit-btn").click(function () {
+ if(hasPayment){
+ if(window.openmobilefun != 'other'){
+ appPayment()
+ }
+ }
+ })
+
+ function appPayment(){
+ var payUrl = getShareLink();
+ $("#commit-btn").css({"background-color":"#eee",});
+ $("#commit-btn").val("订单创建中...");
+ hasPayment = false;
+ $.ajax({
+ url: payUrl,
+ method: 'get',
+ contentType: 'application/json',
+ dataType: 'json',
+ success: function (res) {
+ if(paymentFun == 'Wechat'){
+ if( window.openmobilefun == 'wechat'){
+ invokePay(res.order_id,res.jsapi);
+ }else{
+ redirectH5Payment(res.partner_order_id,res.client_moniker)
+ }
+ }
+ if(paymentFun == 'Alipay'){
+ if(window.openmobilefun == 'alipay'){
+ callPayment(res);
+ }else{
+ redirectH5Payment(res.partner_order_id,res.client_moniker)
+ }
+ }
+ if(paymentFun == 'Bank'){
+ cbbankPayment(res);
+ }
+ },
+ error: function (jqXHR) {
+ alert(jqXHR.responseJSON.message);
+ $("#commit-btn").css({"background-color":"#ED2424",});
+ $("#commit-btn").val("支付");
+ if(maxtime>0){
+ hasPayment = true;
+ }else{
+ hasPayment = false;
+ }
+ }
+ })
+ }
+
+ function redirectH5Payment(orderId,clientMoniker){
+ window.location.href='/api/v1.0/share_code/business/bills/'+clientMoniker+'/orders/'+orderId+'/pay';
+ }
+
+ function getShareLink(){
+ var paymentLink = ''
+ if(window.sharetype != 'app'){
+ //PC端扫码访问
+ if(paymentFun == 'Wechat'){
+ if(window.openmobilefun == 'wechat'){
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/wechat/mobile';
+ }else{
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Wechat';
+ }
+ }
+ if(paymentFun == 'Alipay'){
+ if(window.openmobilefun == 'alipay'){
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile';
+ }else{
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
+ }
+ }
+ if(paymentFun == 'Bank'){
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/cbbank/mobile?partner_moniker='+window.clientmoniker;
+ }
+ }else{
+ //app扫码访问
+ if(paymentFun == 'Wechat'){
+ if(window.openmobilefun == 'wechat'){
+ paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/wechat/share_link';
+ }else{
+ paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Wechat';
+ }
+ }
+ if(paymentFun == 'Alipay'){
+ if(window.openmobilefun == 'alipay'){
+ paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay/share_link'
+ }else{
+ paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
+
+ }
+ }
+ if(paymentFun == 'Bank'){
+ paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/cbbank/share_link?partner_moniker='+window.clientmoniker;
+ }
+ }
+ return paymentLink;
+ }
+
+ //微信支付方式
+ function invokePay(orderId,paydata) {
+ WeixinJSBridge.invoke('getBrandWCPayRequest', {
+ 'appId': paydata.appId,
+ 'timeStamp': paydata.timeStamp,
+ 'nonceStr': paydata.nonceStr,
+ 'package': paydata.package,
+ 'signType': paydata.signType,
+ 'paySign': paydata.paySign
+ }, function (res) {
+ var redirect = "/api/payment/v1.0/wechat_jsapi_payment/partners/" + window.clientmoniker + "/orders/" + orderId+"?";
+ if (res.err_msg == 'get_brand_wcpay_request:ok') {
+ startCheckOrder(orderId,redirect + (redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true')
+ } else {
+ if (res.err_msg == 'get_brand_wcpay_request:cancel') {
+ hasPayment = true;
+ $("#commit-btn").css({"background-color":"#ED2424",});
+ $("#commit-btn").val("支付");
+ }
+ if( res.err_msg == 'get_brand_wcpay_request:fail'){
+ hasPayment = true;
+ $("#commit-btn").css({"background-color":"#ED2424",});
+ $("#commit-btn").val("支付");
+ location.href = redirect + (redirect.indexOf('?') < 0 ? '?' : '&') + 'success=false';
+ }
+ }
+ })
+ }
+
+ //支付宝支付方式
+ function callPayment(paydata) {
+ try {
+ if(typeof paydata.trade_no == 'undefined'){
+ window.location.href = paydata.mweb_url
+ }else {
+ AlipayJSBridge.call('tradePay', {
+ tradeNO: paydata.trade_no
+ }, function (res) {
+ if (res.resultCode == '9000') {
+ AlipayJSBridge.call('startApp', {
+ appId: '20000056',
+ param: {
+ actionType: 'showSuccPage',
+ payResult: res.result
+ },
+ closeCurrentApp: false
+ });
+ startCheckOrder(paydata.order_id, '/api/v1.0/alipay_direct/partners/' + window.clientmoniker + '/orders/' + paydata.order_id + '/result');
+ } else {
+ hasPayment = true;
+ $("#commit-btn").css({"background-color": "#ED2424",});
+ $("#commit-btn").val("支付");
+ }
+ })
+ }
+ } catch (err) {
+ alert(err);
+ $('#wdiv').hide();
+ }
+ }
+
+ //银联支付方式
+ function cbbankPayment(res){
+ if('SUCCESS' !== res.return_code && typeof res.return_code !== 'undefined'){
+ $("#commit-btn").css({"background-color":"#ED2424",});
+ if(maxtime>0){
+ hasPayment = true;
+ }else{
+ hasPayment = false;
+ }
+ }else {
+ location.href = res.pay_url;
+ }
+ }
+
+ //调用查询订单状态方法
+ function startCheckOrder(orderId, url) {
+ function checkOrderStd() {
+ $.ajax({
+ url: '/api/v1.0/payment/orders/' + orderId + '/status',
+ method: 'GET',
+ dataType: 'json',
+ success: function (res) {
+ if (res.paid) {
+ location.href = url;
+ } else {
+ setTimeout(checkOrderStd, 500);
+ }
+ }
+ })
+ }
+
+ checkOrderStd();
+ }
+
+});
\ No newline at end of file
diff --git a/src/main/ui/static/templates/billCode/js/pc_payment.js b/src/main/ui/static/templates/billCode/js/pc_payment.js
new file mode 100644
index 000000000..e69cdfa9f
--- /dev/null
+++ b/src/main/ui/static/templates/billCode/js/pc_payment.js
@@ -0,0 +1,159 @@
+/**
+ * Created by dulingling on 2020-03-25.
+ */
+$(document).ready(function () {
+ var paymentFun = 'Wechat';
+ var maxtime = window.maxtime;
+ var hasPayment =true;//可支付
+
+ if(document.documentElement.clientWidth<500){
+ $('.img-size').css({"height":"28px",})
+ }
+
+ if(window.clientInfo.enable_wechat){
+ var paymentFun = 'Wechat';
+ showQRcode();
+ }else if(window.clientInfo.enable_alipay){
+ var paymentFun = 'Alipay';
+ showQRcode();
+ }else if(window.clientInfo.enable_cb_bankpay){
+ var paymentFun = 'Bank';
+ showQRcode();
+ }
+
+ startCheckOrder();
+
+ setInterval(function(){
+ if(maxtime>0){
+ var countdown=document.getElementById("timer");
+ maxtime=maxtime-1;
+ var minute=parseInt(maxtime/60);
+ var second=parseInt(maxtime%60);
+ countdown.innerHTML=minute+'分'+second+'秒';
+ }else{
+ hasPayment = false;
+ $('#qrImg').empty();
+ }
+ },1000);
+
+
+ $("#select_wechat").click(function(){
+ if(paymentFun != 'Wechat'){
+ paymentFun = 'Wechat'
+ $("#select_wechat").removeClass("no-select-pay-fun").addClass("select-pay-fun");
+ $("#select_alipay").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ $("#select_bank").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ showQRcode();
+ }
+ })
+ $("#select_alipay").click(function(){
+ if(paymentFun != 'Alipay'){
+ paymentFun = 'Alipay'
+ $("#select_wechat").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ $("#select_alipay").removeClass("no-select-pay-fun").addClass("select-pay-fun");
+ $("#select_bank").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ showQRcode();
+ }
+ })
+ $("#select_bank").click(function(){
+ if(paymentFun != 'Bank'){
+ paymentFun = 'Bank'
+ $("#select_wechat").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ $("#select_alipay").removeClass("select-pay-fun").addClass("no-select-pay-fun");
+ $("#select_bank").removeClass("no-select-pay-fun").addClass("select-pay-fun");
+ showQRcode();
+ }
+ })
+
+
+ function showQRcode() {
+ if (hasPayment) {
+ var payUrl = '';
+ var orderId = window.clientmoniker + dateFormat() + String(Math.random()).substring(2, 8).toUpperCase();
+ var channelName = paymentFun == 'Wechat' ? '微信' : '支付宝'
+ if (paymentFun == 'Wechat') {
+ $('#qrImg').empty();
+ document.getElementById("qrImg").style.display = 'block';
+ var selectPaymentHTML =
+ "请使用" + channelName + "客户端扫码支付 " +
+ " ";
+ $('#qrImg').append(selectPaymentHTML)
+ } else if (paymentFun == 'Alipay') {
+ $('#qrImg').empty();
+ document.getElementById("qrImg").style.display = 'block';
+ var selectPaymentHTML =
+ "请使用" + channelName + "客户端扫码支付 " +
+ " ";
+ $('#qrImg').append(selectPaymentHTML)
+ } else if (paymentFun == 'Bank') {
+ $('#qrImg').empty();
+ document.getElementById("qrImg").style.display = 'block';
+ if( hasPayment){
+ createCBBankOrder();
+ }
+ }
+ }
+ }
+
+ function createCBBankOrder() {
+ $.ajax({
+ url: window.cbbankpaymentlink,
+ method: 'get',
+ contentType: 'application/json',
+ dataType: 'json',
+ success: function (res) {
+ cbbankPayment(res);
+ },
+ error: function (jqXHR) {
+ alert(jqXHR.responseJSON.message);
+ if(maxtime>0){
+ hasPayment = true;
+ }else{
+ hasPayment = false;
+ }
+ }
+ })
+
+ }
+
+ function cbbankPayment(res){
+ if('SUCCESS' !== res.return_code && typeof res.return_code !== 'undefined'){
+ }else {
+ location.href = res.pay_url;
+ }
+ }
+
+ //做个每5秒查询查询一次订单状态
+ function startCheckOrder(orderId) {
+ //通知URL
+
+ function checkOrderStd() {
+ $.ajax({
+ url: '/api/v1.0/payment/billOrder/' + window.billInfo.client_order_id + '/status',
+ method: 'GET',
+ dataType: 'json',
+ success: function (res) {
+ if (res.paid) {
+ location.href = res.redirect;
+ } else {
+ setTimeout(checkOrderStd, 500);
+ }
+ }
+ })
+ }
+
+ checkOrderStd();
+ }
+
+ function dateFormat() {
+ var date = new Date();
+ var formatTimeStr = '';
+ formatTimeStr += date.getFullYear();
+ formatTimeStr += date.getMonth()+1;
+ formatTimeStr += date.getDate();
+ formatTimeStr += date.getHours();
+ formatTimeStr += date.getMinutes();
+ formatTimeStr += date.getSeconds();
+ return formatTimeStr;
+ }
+});
\ No newline at end of file
diff --git a/src/main/ui/static/templates/payment/v1/card_pay.js b/src/main/ui/static/templates/payment/v1/card_pay.js
index 95dfb5edc..b8ccf86aa 100644
--- a/src/main/ui/static/templates/payment/v1/card_pay.js
+++ b/src/main/ui/static/templates/payment/v1/card_pay.js
@@ -1,6 +1,9 @@
$(function () {
let $container = $('.card-input-box')[0];
+ let ctrl = {ready: false, pending: false}
let cardFrame = window.channel_account_id ? new TokenInputFrame($container, window.channel_account_id) : new CardInputFrame($container);
+ let $errorMsgBox = $('#errorMsgBox');
+ let loading = $('.loading-container');
cardFrame.onSuccess = function (secretData) {
$.ajax({
url: 'commit',
@@ -11,10 +14,12 @@ $(function () {
startCheckOrder(window.client_moniker, window.partner_order_id);
},
error: function (jqXHR) {
+ ctrl.pending = false;
+ loading.addClass('hide')
let errorText = jqXHR.responseText;
let err = JSON.parse(errorText);
- if(err){
- $('#errorMsgBox').text(err.message).show();
+ if (err) {
+ $errorMsgBox.text(err.message).show();
}
}
})
@@ -25,13 +30,31 @@ $(function () {
border: 'none',
borderRadius: '10px'
};
+ cardFrame.onReady = function () {
+ $('#readyModal').hide();
+ $('#payBtn').removeAttr('disabled');
+ ctrl.ready = true;
+ loading.addClass('hide');
+ };
cardFrame.onError = function (msg) {
- $('#errorMsgBox').text(msg).show();
+ $errorMsgBox.text(msg).show();
+ ctrl.pending = false;
+ loading.addClass('hide')
};
cardFrame.show();
$('#payBtn').click(function () {
- $('#errorMsgBox').hide();
+ if (!ctrl.ready) {
+ $errorMsgBox.text('Loading...').show();
+ return;
+ }
+ if (ctrl.pending) {
+ $errorMsgBox.text('Pending...').show();
+ return;
+ }
+ ctrl.pending = true;
+ loading.removeClass('hide');
+ $errorMsgBox.hide();
cardFrame.commit();
});
@@ -51,6 +74,10 @@ $(function () {
})
}
+ if (ctrl.checking) {
+ return;
+ }
+ ctrl.checking = true;
checkOrderStd();
}
});
diff --git a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/GatewayApplicationMerchantDemoTest.java b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/GatewayApplicationMerchantDemoTest.java
index 8a3565b6e..3b5d44851 100644
--- a/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/GatewayApplicationMerchantDemoTest.java
+++ b/src/test/java/au/com/royalpay/payment/manage/citypartner/core/impls/GatewayApplicationMerchantDemoTest.java
@@ -219,9 +219,9 @@ public class GatewayApplicationMerchantDemoTest {
@Test
public void updateFile() throws Exception{
- String originUrl = "https://sandbox.royalpay.com.au/api/v1.0/org_gateway/partners/" + SHORTID + "/attachment/files";
+ String originUrl = "http://127.0.0.1:9002/attachment/secret_files";
String url = addSignUrl(originUrl, null, SPDEMOPRIKEY);
- File file = new File("/Users/1/Downloads/banner_eshop.jpg");
+ File file = new File("/Users/luoyang/Downloads/banner_eshop.jpg");
InputStream stream = new FileInputStream(file);
HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.POST);
gen.setTimeout(10000);
|