diff --git a/pom.xml b/pom.xml index c05d0c960..c44941411 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.3.6 + 2.3.7 4.0.0 manage - 2.4.9 + 2.4.12 UTF-8 2.4.0 diff --git a/src/document/openapi/cn/document.yml b/src/document/openapi/cn/document.yml index b37985abd..4bfbc5465 100644 --- a/src/document/openapi/cn/document.yml +++ b/src/document/openapi/cn/document.yml @@ -99,8 +99,6 @@ servers: description: production - url: https://au.rpaygroup.com/api/v1.0 description: proxy - - url: https://sandbox.royalpay.com.au/api/v1.0 - description: sandbox tags: - name: PublicApi description: 公共API @@ -867,13 +865,13 @@ paths: code_url: type: string description: 付款码字符串,商户可自行生成二维码 # todo - /alipay/partners/{partner_code}/orders/{partner_order_id}: + /web_gateway/partners/{partner_code}/orders/{partner_order_id}: put: summary: 渠道网关订单下单 x-sort-order: 0 description: | - 创建订单后跳转到返回的pay_url(需附加签名参数和redirect参数),随后进入支付宝支付页面完成支付 - 该接口现仅支持支付宝。 + 创建订单后跳转到返回的pay_url(需附加签名参数和redirect参数),随后进入渠道网关支付页面完成支付 + 该接口现仅支持支付宝和Alipay+。 tags: - ChannelGateway parameters: diff --git a/src/document/openapi/en/document.yml b/src/document/openapi/en/document.yml index ce45d3310..0665f2fa0 100644 --- a/src/document/openapi/en/document.yml +++ b/src/document/openapi/en/document.yml @@ -97,8 +97,6 @@ info: servers: - url: https://mpay.royalpay.com.au/api/v1.0 description: production - - url: https://sandbox.royalpay.com.au/api/v1.0 - description: sandbox tags: - name: PublicApi description: Public API @@ -147,10 +145,10 @@ tags: Retail payment API for merchants has their own machine. Has 2 modes: - Merchant scanner scan customer provided payment code.(B scan C) - Customer scan merchant provided collection code. (C scan B) - - name: AlipayOnline + - name: ChannelGateway description: | - Use for Alipay Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Alipay page to finish payment. - Alipay Channel only + Use for Channel Cashier Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Channel cashier page to finish payment. + Alipay and AlipayPlus Channels only - name: CB Bank description: | @@ -262,7 +260,7 @@ paths: - SDK Payment - CB Bank - RetailPay - - AlipayOnline + - ChannelGateway - CardPayment - MiniProgram - MobileH5 @@ -290,7 +288,7 @@ paths: - SDK Payment - CB Bank - RetailPay - - AlipayOnline + - ChannelGateway - CardPayment - MiniProgram - MobileH5 @@ -890,14 +888,14 @@ paths: code_url: type: string description: QR Code string. Partners can create the payment QR Code according to this value. - /alipay/partners/{partner_code}/orders/{partner_order_id}: + /web_gateway/partners/{partner_code}/orders/{partner_order_id}: put: - summary: Alipay WEB Order + summary: Channel WEB Order description: | - Use for Alipay Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Alipay page to finish payment. - Alipay Channel Only. + Use for Channel Payment Cashier in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param. Then enter Channel cashier page to finish payment. + Alipay and AlipayPlus only at the moment. tags: - - AlipayOnline + - ChannelGateway parameters: - name: partner_code in: path @@ -1108,7 +1106,7 @@ paths: - MobileH5 - MiniProgram - CardPayment - - AlipayOnline + - ChannelGateway - RetailPay - CB Bank - SDK Payment @@ -1153,7 +1151,7 @@ paths: - MobileH5 - MiniProgram - CardPayment - - AlipayOnline + - ChannelGateway - RetailPay - CB Bank - SDK Payment @@ -1333,7 +1331,7 @@ paths: - SDK Payment - CB Bank - RetailPay - - AlipayOnline + - ChannelGateway - CardPayment - MiniProgram - MobileH5 @@ -1378,7 +1376,7 @@ paths: description: Currency, AUD channel: type: string - description: Payment Channel Alipay, AlipayOnline, Wechat + description: Payment Channel Alipay, AlipayOnline, Wechat, AlipayPlus create_time: type: string format: 'date-time' diff --git a/src/main/ui/static/analysis/clearing-log.js b/src/main/ui/static/analysis/clearing-log.js index bfdde620b..de03c8a8f 100644 --- a/src/main/ui/static/analysis/clearing-log.js +++ b/src/main/ui/static/analysis/clearing-log.js @@ -568,6 +568,9 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func return '/static/images/card_payment_sign_lg.png'; case 'rpaypmt_dd': return '/static/images/direct_debit_sign_lg.png'; + case 'ApsInStore': + case 'ApsCashier': + return '/static/images/alipay_aps.jpg'; } } }); diff --git a/src/main/ui/static/commons/services/clearingDetailService.js b/src/main/ui/static/commons/services/clearingDetailService.js index 1acf1105a..8cdb197b3 100644 --- a/src/main/ui/static/commons/services/clearingDetailService.js +++ b/src/main/ui/static/commons/services/clearingDetailService.js @@ -121,6 +121,9 @@ define(['../app','decimal'], function (app,Decimal) { return '/static/images/card_payment_sign_lg.png'; case 'rpaypmt_dd': return '/static/images/direct_debit_sign_lg.png'; + case 'ApsInStore': + case 'ApsCashier': + return '/static/images/alipay_aps.jpg'; } } }); diff --git a/src/main/ui/static/config/bdprize/bdprize.js b/src/main/ui/static/config/bdprize/bdprize.js index 16a873dd7..e6446c99a 100644 --- a/src/main/ui/static/config/bdprize/bdprize.js +++ b/src/main/ui/static/config/bdprize/bdprize.js @@ -526,6 +526,9 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) { return '/static/images/card_payment_sign_lg.png' case 'rpaypmt_dd': return '/static/images/direct_debit_sign_lg.png' + case 'ApsInStore': + case 'ApsCashier': + return '/static/images/alipay_aps.jpg'; } } }) diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 2c9e5aa1e..ee5562f0f 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -7143,7 +7143,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter params.company_website = null } - if (params.merchant_type == 'ENTERPRISE') { + // if (params.merchant_type == 'ENTERPRISE') { params.director_name = $scope.subMerchantInfo.director_name params.director_id_number = $scope.subMerchantInfo.director_id_number params.company_register_no = $scope.subMerchantInfo.company_register_no @@ -7159,10 +7159,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert('Certificate expiration time is required') return } - } else { - params.principal_name = $scope.subMerchantInfo.principal_name - params.principal_id_number = $scope.subMerchantInfo.principal_id_number - } + // } else { + // params.principal_name = $scope.subMerchantInfo.principal_name + // params.principal_id_number = $scope.subMerchantInfo.principal_id_number + // } $http.post('/sys/partners/' + $scope.subMerchantInfo.client_moniker + '/new_sub_apply', params).then( function (resp) { @@ -7334,7 +7334,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter // params.principal_name = $scope.subMerchantInfo.principal_name; // params.principal_id_number = $scope.subMerchantInfo.principal_id_number; // } - if (params.merchant_type == 'ENTERPRISE') { + // if (params.merchant_type == 'ENTERPRISE') { params.company_register_no = $scope.subMerchantInfo.company_register_no params.certificat_expire_date = $scope.subMerchantInfo.certificat_expire_date if ($scope.subMerchantInfo.certificat_expire_date_d) { @@ -7347,7 +7347,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter alert('Certificate expiration time is required') return } - } + // } $http.put('/sys/partners/' + $scope.merchantInfo.client_moniker + '/get_merchant_ids/' + $scope.subMerchantInfo.merchant_app_id, params).then( function (resp) { $scope.apply_sub_merchant_id = resp.data 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 720d630d4..0bff4f0c3 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -309,7 +309,7 @@ -
diff --git a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html index 350ef9e59..79bf783f4 100644 --- a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html +++ b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html @@ -233,7 +233,7 @@
-
diff --git a/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html index 8db9d696a..792d1860e 100644 --- a/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/new_apply_wx_sub_merchant_id.html @@ -213,7 +213,7 @@
-
@@ -227,7 +227,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 588de9045..755c05b7d 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -330,7 +330,7 @@
-
diff --git a/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html index 13a41048d..da11ac457 100644 --- a/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html +++ b/src/main/ui/static/payment/partner/templates/update_apply_wx_sub_merchant_id.html @@ -223,7 +223,7 @@
-
@@ -255,7 +255,7 @@ -
diff --git a/src/main/ui/static/templates/alipayaps/v1/payment.js b/src/main/ui/static/templates/alipayaps/v1/payment.js index 901912491..f38b16818 100644 --- a/src/main/ui/static/templates/alipayaps/v1/payment.js +++ b/src/main/ui/static/templates/alipayaps/v1/payment.js @@ -256,6 +256,7 @@ $(function () { } data.coupons = dataCache.coupons; data.qrcodeVersion = window.qrcodeVersion; + data.apsoverseas = window.apsoverseas; $.ajax({ url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders', diff --git a/src/main/ui/static/templates/alipayaps/v4/payment.js b/src/main/ui/static/templates/alipayaps/v4/payment.js index 19ed5b9ed..5f26928b8 100644 --- a/src/main/ui/static/templates/alipayaps/v4/payment.js +++ b/src/main/ui/static/templates/alipayaps/v4/payment.js @@ -302,6 +302,8 @@ $(function () { } data.coupons = dataCache.coupons; data.qrcodeVersion = window.qrcodeVersion; + data.apsoverseas = window.apsoverseas; + $.ajax({ url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders', method: 'POST', diff --git a/src/main/ui/static/templates/alipayaps/v5/payment.js b/src/main/ui/static/templates/alipayaps/v5/payment.js index f5d4c4543..60cd485e7 100644 --- a/src/main/ui/static/templates/alipayaps/v5/payment.js +++ b/src/main/ui/static/templates/alipayaps/v5/payment.js @@ -265,6 +265,8 @@ $(function () { } data.coupons = dataCache.coupons; data.qrcodeVersion = window.qrcodeVersion; + data.apsoverseas = window.apsoverseas; + $.ajax({ url: '/api/v1.0/alipay_aps/partners/' + window.client_moniker + '/orders', method: 'POST', diff --git a/src/main/ui/static/templates/billCode/js/mobile_payment.js b/src/main/ui/static/templates/billCode/js/mobile_payment.js index ca4e81309..9c4b57f94 100644 --- a/src/main/ui/static/templates/billCode/js/mobile_payment.js +++ b/src/main/ui/static/templates/billCode/js/mobile_payment.js @@ -107,7 +107,7 @@ $(document).ready(function () { } if(paymentFun == 'AlipayAps'){ if(window.openmobilefun == 'alipayaps'){ - callPayment(res); + callAlipayAps(res); }else{ redirectH5PaymentForAps(res.partner_order_id,res.client_moniker) } @@ -297,4 +297,46 @@ $(document).ready(function () { checkOrderStd(); } + function callApp(scheme_seq, index, timeout) { + let timer, start = new Date().getTime() + let promise = new Promise(((resolve, reject) => { + location.href = scheme_seq[index] + window.addEventListener('visibilitychange', () => { + if (document.visibilityState === 'hidden') { + clearTimeout(timer); + resolve() + } + }); + timer = setTimeout(() => { + let end = new Date().getTime() + if (end - start > timeout + 1000) { + clearTimeout(timer) + resolve() + } else { + if (index + 1 < scheme_seq.length) { + callApp(scheme_seq, index + 1, timeout).then(resolve, reject) + } else { + reject() + } + } + }, timeout) + })) + return promise + } + function callAlipayAps(order) { + + if(order.jsapi){ + let try_sequence = [order.jsapi.normal_url,order.jsapi.scheme_url, order.jsapi.applink_url] + try_sequence = try_sequence.filter(v => v != null) + callApp(try_sequence, 0, 5000).then(() => { + alert('redirect success') + }, () => { + alert('redirect failure') + }) + }else { + location.href = order.web_url + } + } + + }); \ No newline at end of file