From 545be6818fe2854f005bc82ffafc7344761f3b90 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 9 Apr 2020 14:51:20 +0800 Subject: [PATCH 01/17] fix merge --- .../core/impls/RetailRSvcServiceImpl.java | 79 ++++++++++--------- .../manage/mappers/system/ClientMapper.java | 8 +- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java index 56698f217..15dba879d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java @@ -217,7 +217,10 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { String title = params.getString("title"); String body = params.getString("body"); String url = decData(params.getString("url"), key, svcInfo.getString("platform_pri_key")); - sendRServiceNotifyMessage(client, title, body, url); + if (StringUtils.equalsIgnoreCase("PINE", client.getString("client_moniker"))|| + StringUtils.equalsIgnoreCase("TUTU", client.getString("client_moniker"))) { + sendRServiceNotifyMessage(client, title, body, url); + } result.put("result_status", "SUCCESS"); } catch (Exception e) { logger.error("geek notify app fail:{} - {}",sourceCode,e.getMessage()); @@ -254,45 +257,43 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { private void sendRServiceNotifyMessage(JSONObject client, String title, String body, String url) { logger.debug("sendGeekMessage Begin"); -// List clientTokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id")); -// for (JSONObject token : clientTokens) { -// -// } - JSONObject devToken = clientDeviceTokenMapper.getTestTokens(); - Runnable task = () -> { - String token = devToken.getString("token"); - JSONObject log = saveAppMessageLog(devToken.getString("dev_id"), - devToken.getIntValue("client_id"), - "annual_bill" + devToken.getString("client_type"), - token, - "跨境商城推送" - ); - try { - JSONObject type = new JSONObject(); - type.put("send_type", "annual_bill"); - type.put("id", devToken.getString("dev_token_id")); - AppMsgSender sender = senderMap.get((devToken.getString("client_type"))); - if (StringUtils.isBlank(token) || sender == null) { - return; + List clientTokens = clientDeviceTokenMapper.listTokensByClient_id(client.getIntValue("client_id")); + for (JSONObject tokenJson : clientTokens) { + Runnable task = () -> { + String token = tokenJson.getString("token"); + JSONObject log = saveAppMessageLog(tokenJson.getString("dev_id"), + tokenJson.getIntValue("client_id"), + "annual_bill" + tokenJson.getString("client_type"), + token, + "跨境商城推送" + ); + try { + JSONObject type = new JSONObject(); + type.put("send_type", "annual_bill"); + type.put("id", tokenJson.getString("dev_token_id")); + AppMsgSender sender = senderMap.get((tokenJson.getString("client_type"))); + if (StringUtils.isBlank(token) || sender == null) { + return; + } + JSONObject managerMsg = new JSONObject(); + managerMsg.put("title", title); + managerMsg.put("body", body); + managerMsg.put("type", type); + JSONObject messageData = new JSONObject(); + messageData.put("url", url); + managerMsg.put("data", messageData); + managerMsg.put("msgType", "annual_bill"); + AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); + sender.sendMessage(appMessage, tokenJson); + log.put("status", 2); + appMessageLogMapper.update(log); + } catch (Exception e) { + logger.error("出错了:" + e.getMessage()); + appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); } - JSONObject managerMsg = new JSONObject(); - managerMsg.put("title", title); - managerMsg.put("body", body); - managerMsg.put("type", type); - JSONObject messageData = new JSONObject(); - messageData.put("url", url); - managerMsg.put("data", messageData); - managerMsg.put("msgType", "annual_bill"); - AppMessage appMessage = new AppManagerMessageBuilder(managerMsg).buildMessage(); - sender.sendMessage(appMessage, devToken); - log.put("status", 2); - appMessageLogMapper.update(log); - } catch (Exception e) { - logger.error("出错了:" + e.getMessage()); - appMessageLogMapper.updateStatus(log.getString("send_id"), 1, e.getMessage()); - } - }; - sendingAppleMsgPool.execute(task); + }; + sendingAppleMsgPool.execute(task); + } } private String encData(String data, Key key, String publicKey) { diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index a49330f20..e6ed55306 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -1,12 +1,12 @@ package au.com.royalpay.payment.manage.mappers.system; +import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.yixsoft.support.mybatis.autosql.annotations.AdvanceSelect; import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper; import com.yixsoft.support.mybatis.autosql.annotations.AutoSql; import com.yixsoft.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import com.github.miemiedev.mybatis.paginator.domain.PageBounds; -import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; @@ -24,7 +24,7 @@ public interface ClientMapper { JSONObject findClient(@Param("client_id") int clientId); @AutoSql(SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5") + @AdvanceSelect(addonWhereClause = "is_valid=1 and length( client_moniker ) > 5 and sub_merchant_id='321888408'") List findApClient(); List listValidClient(); From 191d676ddb2b09c9162624453ee6e1e746e35fa6 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 9 Apr 2020 16:26:12 +0800 Subject: [PATCH 02/17] fastjson 1.2.62->1.2.68 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c23d50805..ad128b7b8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,11 +5,11 @@ au.com.royalpay.payment payment-parent - 2.1.4 + 2.1.5 4.0.0 manage - 2.1.2 + 2.1.3 UTF-8 1.8.0 @@ -77,7 +77,7 @@ com.alibaba fastjson - 1.2.62 + 1.2.68 org.springframework.boot From 4e339e750deff65fbc18c82da7a9dd2526f5ab0c Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 9 Apr 2020 16:28:51 +0800 Subject: [PATCH 03/17] fastjson 2.1.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad128b7b8..1f4b47442 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 2.1.5 + 2.1.6 4.0.0 manage From 1842bb0cea4a6bc4fb653eb111d8f71f6fcca402 Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 9 Apr 2020 18:04:58 +0800 Subject: [PATCH 04/17] nginx update --- uidocker/conf.d/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uidocker/conf.d/default.conf b/uidocker/conf.d/default.conf index b8ac6c383..beb93bbf7 100644 --- a/uidocker/conf.d/default.conf +++ b/uidocker/conf.d/default.conf @@ -68,7 +68,7 @@ server { } - location ~ ^/api/v1.0/((jd)|(customs)|(alipay)|(rpay)|(yeepay)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(wechat_jsapi_gateway)|(h5_payment)|(gateway)|(hf_gateway)|(jd_gateway)|(micropay)|(retail_qrcode)|(jsapi_gateway)|(share_code)|(payment))/ { + location ~ ^/api/v1.0/((jd)|(customs)|(alipay)|(rpay)|(yeepay)|(card_payment_view)|(lakala_pay)|(cb_bankpay)|(bestpay)|(hf)|(wechat_jsapi_gateway)|(h5_payment)|(gateway)|(hf_gateway)|(jd_gateway)|(micropay)|(retail_qrcode)|(jsapi_gateway)|(share_code)|(payment))/ { proxy_pass http://rppaycenter; proxy_http_version 1.1; From 04c052b75fd3f45c1f9fd82ca27a2162c656267c Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 9 Apr 2020 18:05:47 +0800 Subject: [PATCH 05/17] build: 2.1.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f4b47442..2831d4261 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 2.1.6 + 2.1.7 4.0.0 manage From 2713b90c13a9cb7549c58325faf000f7cb1c4f3c Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 9 Apr 2020 18:21:26 +0800 Subject: [PATCH 06/17] js update --- src/main/ui/static/templates/payment/v1/card_pay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 043c2273d..37fdd680b 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,6 @@ $(function () { let $container = $('.qr-img-box')[0]; - let cardFrame = window.channel_account_id ? TokenInputFrame($container, window.channel_account_id) : CardInputFrame($container); + let cardFrame = window.channel_account_id ? new TokenInputFrame($container, window.channel_account_id) : new CardInputFrame($container); cardFrame.onSuccess = function (secretData) { $.ajax({ url: 'commit', From dc342ced841f194e112b1f0e97ccec6c41d69cbd Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 9 Apr 2020 18:36:05 +0800 Subject: [PATCH 07/17] js update --- src/main/resources/application-rppaysvc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-rppaysvc.yml b/src/main/resources/application-rppaysvc.yml index 68ffcf7f1..484d8a4f6 100644 --- a/src/main/resources/application-rppaysvc.yml +++ b/src/main/resources/application-rppaysvc.yml @@ -1,6 +1,6 @@ app: rpaysvc: - appid: 3daefd62-3003-4a93-821e-5962d5ff67c2 + appid: royalpaytest priv-key: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDE55tREo6t6m1hekGlaMmDivorV3a+MkA/Wna0k917u/CGYIf7FtmWk1um7VcBRdljluLjqThePZgbgtwqTdHWXJP2gPwoJjLUluVEyKh19blSgrq7K1FEryAzQ5XFLzMX//EMc1BNrqcREHC6XVlJeNzpOd8+C83cxGxL+ayLoQ/ePEyp/8yXBbA6t2yXyi7H1ry8WiFFg9RFf+zAeESFXlKIS72fw9I9GxG6PLUhbD8S+IIJ2A0ZudKUQIUw4M0wSilo40lfqp/xRyfUBZevKcPrO5/ZCJX6V2d154s1m5p0Z/eLtQ1ido0quVi/LzBb1KXDYNHV6hPJjNQmNbMnAgMBAAECggEAY/rqLW9LzVk0cwN947xiXg2qW2mM3KRtZP3NOoG+O37BcaoAQelnUILATfFDdVz/Ngc+a7TX71o9KvL2UfCztLHLW6ZA4y4KL1HzVkrA5yx/DjtdD36+RC7cHcuad8YwnmYSAm1nABrHr+12H9sYZCsfmLkO9tVNkWSXTLiY+UhJ1hTua2LYgaTsHR9lYLt/K+PNIBAToKuMcKFTEMWbrnekrFhXkPdeS3alFL/0X7csaPhLvZTDaAtpAytvnmN4nuZmnONnDqPJ3IEFjc7xwZ15D9Qgv/+g74q1VzU/0+2421S6BSijUK3kUdeHXASU3YvIczfnbr5t+NYL7nd68QKBgQDlLFNMz9rVFLd5b351tnld9rni8KzHi+V+eXeJpQ+zriTODOvvkFJrTSZKm+JQoBrpTI+EA1fovxLnDBhNnrR4HmHhudMTGqU6JOZLj+fk8UQKXDpVEGWO6QT68ds+Ii1ex1UEkbBkLWGrrHlFAdY0q+Af7L7Fe0osZX9382b+aQKBgQDb9EmDD79IFOxSjMJVnlN0g2P48hQ9M40cEzXRD/iyyBr9l8rE400Q6GT35ZgHKSrG2nXZehWCaQQqniHu+y6UHnJfhbC0LEYdcYRoyamlGwEFp8xSRJ88R2IoL+2g+XJ1Tc6eACjsEJWZooga6bqdrYjaAe0uSGid0Buh6JMTDwKBgGIfJFtS84MgJ55a2m5T/or4xIYiPhgCEfSg1Umd3qcz/JYseihMRr2ifq6bJ78VjfAt05TWSaFhjhpW12EEfoifmZEoGvOnCO9oNSJNLyCbHGLDMkaRiqoxouw++XwU7hASkJgwOLHrrFHwusuNCcXrgT6qAtRTAWMY4gbdtE9hAoGAWnZsTZUKbND+KS1vN9t4I3FuipK1tD4hiSx1c9iHxq/6OdZWNQfvSEbsT/CDyF4sE8EBu0I02n/qkMSc3Dc+fvjOvW60sEWNSMrJVHesaBVlJDhRFnzWqOoK+tBLgWtWodwwYFdcfUqM3LU2GSuL7xHSOSeVrvVk4ZMX6k1HQA0CgYAypY0eecX8Gc7SCt7wpYoNuL2MuZZIDXNZVMpWYMokA1Z74oX1uzecyTNLHgCFHpjiJPyc6KW1/pnDpcA9FuTmLUuNyuqsX85IEMZPkIqPFebAl4IvOuwzvXDPxxgh8B+XBQBydgFADeqgqXG8rxomC4PUrX47pKb1G89bTGp8Dw== pub-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmifNnVZG6HZBYdvLnCGyNm7rQTZKyl3w+7xdBGgjsQeaskdy/IgmrWRG4Ii1o82KV/ZA+bw86vE37axpoxbqOU3LYVb69nVYvmJOL018iBs74HhbZ8CtWtQmEIKqmX/rNUdp15OgwzDckvrK/EEzjdOoQfAkFB68wLOsTcsRwBB3JUL/uiHGK6b5Ofmh4PxYeAVNpWYHyCaQIuN6JH85VHBVS4etP25GbgWxl+ktuZucaPsQ2G25mwhlpNiC28J4la0wD33JKMfCNCjORlWkw2HcDvrRLqza4lJOXu0rFy3JuUkZ0hn834ZWd3MboqNNE6a2xe4ppZUJ9ccM9312JQIDAQAB server-root: https://channel.rpayplus.com/channel/v1/ From 0a0064b53e764fdd11d5ae2c68acde8f66c52e5c Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 09:36:36 +0800 Subject: [PATCH 08/17] update cardpay ui --- src/main/ui/static/css/cardpay.css | 153 ++++++++++++++++++ .../static/templates/payment/v1/card_pay.js | 6 +- .../manage/task/RegisterRpPaymentMch.java | 38 +++++ 3 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 src/main/ui/static/css/cardpay.css create mode 100644 src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java diff --git a/src/main/ui/static/css/cardpay.css b/src/main/ui/static/css/cardpay.css new file mode 100644 index 000000000..13a5411bb --- /dev/null +++ b/src/main/ui/static/css/cardpay.css @@ -0,0 +1,153 @@ +.qrpay-background { + position: fixed; + background: #f2f2f2; + top: 0; + bottom: 0; + right: 0; + left: 0; + z-index: -1; +} + +section.content { + position: absolute; + top: 70px; + bottom: 64px; + width: 100%; + overflow: auto; + left: 0; +} + +.qrpay-container { + width: 600px; + position: relative; + display: block; + margin: 40px auto; + background: #fff; + overflow: visible; + box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.30); +} + +.qrpay-container .qr-brand { + width: 100%; + height: 80px; + padding-top: 20px; +} + +.qrpay-container .qr-brand.wechat { + background: #09bb07; +} + +.qrpay-container .qr-brand.alipay { + background: #1eabeb; +} + +.qrpay-container .qr-brand > .wechat-logo { + display: block; + margin: auto; + height: 40px; +} + +.qrpay-container .price-box { + position: relative; + display: block; + margin: 15px auto; + width: 240px; +} + +.qrpay-container .price-box:after { + content: ''; + display: block; + clear: both; +} + +.qrpay-container .price-box .exchange-rate { + font-size: 16px; + display: block; +} + +.qrpay-container .price-box .price { + font-size: 22px; + float: left; + line-height: 28px; +} + +.qrpay-container .price-box .price-left { + font-weight: bold; + border-right: 2px solid #666; + padding-right: 10px; +} + +.qrpay-container .price-box .price-right { + padding-left: 10px; + width: 49%; + white-space: nowrap; + text-align: left; +} + +.qrpay-container .card-input-box { + width: 100%; + height: 400px; + margin: auto auto 15px; + text-align: center; + border: none; +} + +.qrpay-container .qrcode-img { + width: 140px; + height: 140px; + position: relative; + display: block; + margin: auto; +} + +.qrpay-container .qr-footer { + position: relative; + bottom: 0; + border-radius: 0 0 10px 10px; + width: 100%; + padding: 10px; + background: #f7f7f7; + color: #000; +} + +.qrpay-container .qr-footer .form-group { + margin-bottom: 2px; + font-size: 12px; + line-height: 12px; +} + +.qrpay-container .qr-desc { + position: absolute; + height: 150px; + z-index: 999; + top: 140px; + right: 30px; +} + +#footer { + position: absolute; + width: 100%; + bottom: 0; +} + +@media (max-width: 997px) { + section.content { + width: 100%; + position: relative; + bottom: 0; + top: 0; + overflow: visible; + } + + .qrpay-container { + width: 100%; + } + + #footer { + position: relative; + } + + .qr-desc { + display: none; + } +} \ 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 37fdd680b..dcd5505b5 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -1,5 +1,5 @@ $(function () { - let $container = $('.qr-img-box')[0]; + let $container = $('.card-input-box')[0]; let cardFrame = window.channel_account_id ? new TokenInputFrame($container, window.channel_account_id) : new CardInputFrame($container); cardFrame.onSuccess = function (secretData) { $.ajax({ @@ -11,6 +11,10 @@ $(function () { } }) }; + cardFrame.frameStyle = { + width: '100%', + height: '100%' + }; cardFrame.show(); $('#payBtn').click(function () { diff --git a/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java b/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java new file mode 100644 index 000000000..04baa5727 --- /dev/null +++ b/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java @@ -0,0 +1,38 @@ +package au.com.royalpay.payment.manage.task; + +import au.com.royalpay.payment.channels.rpaypaymentsvc.runtime.RPayPaymentCardSvcApi; +import au.com.royalpay.payment.core.beans.EmptyMerchantApplication; +import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; +import com.alibaba.fastjson.JSONObject; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * Create by davep at 2020-04-09 18:15 + */ +@SpringBootTest +@ActiveProfiles("officedev,wechat,jd,alipay,bestpay,rpay,yeepay,lakala,rppaysvc") +@RunWith(SpringJUnit4ClassRunner.class) +public class RegisterRpPaymentMch { + @Autowired + private RPayPaymentCardSvcApi api; + @Autowired + private MerchantInfoProvider mchInfoProvider; + @Autowired + private ManagerMapper managerMapper; + + @Test + @Ignore + public void register() { + JSONObject client = mchInfoProvider.getClientInfo(9); + JSONObject manager = managerMapper.findByLoginId("yixian"); + api.apply(client, new EmptyMerchantApplication(), manager); + } + +} From 1dca324d359d29bff93668eb5cc7fc635f419c17 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 09:52:01 +0800 Subject: [PATCH 09/17] update cardpay ui --- src/main/ui/static/css/cardpay.css | 2 +- src/main/ui/static/templates/payment/v1/card_pay.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/ui/static/css/cardpay.css b/src/main/ui/static/css/cardpay.css index 13a5411bb..b49ce280c 100644 --- a/src/main/ui/static/css/cardpay.css +++ b/src/main/ui/static/css/cardpay.css @@ -18,7 +18,7 @@ section.content { } .qrpay-container { - width: 600px; + width: 900px; position: relative; display: block; margin: 40px auto; 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 dcd5505b5..1cae5824d 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -13,7 +13,8 @@ $(function () { }; cardFrame.frameStyle = { width: '100%', - height: '100%' + height: '100%', + border: 'none' }; cardFrame.show(); From 0aa484338704833f4b828f69ea0647153309ca62 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 10:39:34 +0800 Subject: [PATCH 10/17] update cardpay ui --- src/main/ui/static/templates/payment/v1/card_pay.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 1cae5824d..207023047 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -13,12 +13,15 @@ $(function () { }; cardFrame.frameStyle = { width: '100%', - height: '100%', border: 'none' }; + cardFrame.onError = function (msg) { + $('#errorMsgBox').text(msg).show(); + }; cardFrame.show(); $('#payBtn').click(function () { + $('#errorMsgBox').hide(); cardFrame.commit(); }); From 4f1f292f08d0d8d1a1d9c5248ec99aaecb6a3290 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 10:45:02 +0800 Subject: [PATCH 11/17] update cardpay ui --- src/main/ui/static/css/cardpay.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/ui/static/css/cardpay.css b/src/main/ui/static/css/cardpay.css index b49ce280c..cc8b6b09c 100644 --- a/src/main/ui/static/css/cardpay.css +++ b/src/main/ui/static/css/cardpay.css @@ -18,7 +18,7 @@ section.content { } .qrpay-container { - width: 900px; + width: 700px; position: relative; display: block; margin: 40px auto; @@ -86,8 +86,6 @@ section.content { .qrpay-container .card-input-box { width: 100%; - height: 400px; - margin: auto auto 15px; text-align: center; border: none; } From 7f2ce325dab5d7b3b8cb11e3813e58fbe331ef74 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 12:51:52 +0800 Subject: [PATCH 12/17] update cardpay ui --- pom.xml | 2 +- src/main/ui/static/templates/payment/v1/card_pay.js | 1 + .../com/royalpay/payment/manage/task/RegisterRpPaymentMch.java | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 2831d4261..ac75bc895 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 2.1.7 + 2.1.8 4.0.0 manage 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 207023047..b35850228 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -13,6 +13,7 @@ $(function () { }; cardFrame.frameStyle = { width: '100%', + height: '400px', border: 'none' }; cardFrame.onError = function (msg) { diff --git a/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java b/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java index 04baa5727..2d751cd05 100644 --- a/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java +++ b/src/test/java/au/com/royalpay/payment/manage/task/RegisterRpPaymentMch.java @@ -28,9 +28,8 @@ public class RegisterRpPaymentMch { private ManagerMapper managerMapper; @Test - @Ignore public void register() { - JSONObject client = mchInfoProvider.getClientInfo(9); + JSONObject client = mchInfoProvider.getClientInfoByMoniker("MATX"); JSONObject manager = managerMapper.findByLoginId("yixian"); api.apply(client, new EmptyMerchantApplication(), manager); } From 432dc23671589029a75996378b6f1a0fdc83e615 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 12:53:16 +0800 Subject: [PATCH 13/17] update cardpay ui --- src/main/ui/static/css/cardpay.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/ui/static/css/cardpay.css b/src/main/ui/static/css/cardpay.css index cc8b6b09c..abb0b1b61 100644 --- a/src/main/ui/static/css/cardpay.css +++ b/src/main/ui/static/css/cardpay.css @@ -122,6 +122,10 @@ section.content { right: 30px; } +.qrpay-container .btn{ + border-radius: 0; +} + #footer { position: absolute; width: 100%; From 2b61487add146aa64103073ca25b261bb0c75da8 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 13:36:42 +0800 Subject: [PATCH 14/17] update cardpay ui --- src/main/ui/static/templates/payment/v1/card_pay.js | 1 + 1 file changed, 1 insertion(+) 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 b35850228..8f45e321f 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -6,6 +6,7 @@ $(function () { url: 'commit', data: JSON.stringify(secretData), contentType: 'application/json', + method: 'POST', success: function () { startCheckOrder(window.client_moniker, window.partner_order_id); } From c857f05dbbc932cec6e85c83f9ed908449c61da6 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 10 Apr 2020 13:43:17 +0800 Subject: [PATCH 15/17] update cardpay ui --- src/main/ui/static/templates/payment/v1/card_pay.js | 7 +++++++ 1 file changed, 7 insertions(+) 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 8f45e321f..22cbcd1cd 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -9,6 +9,13 @@ $(function () { method: 'POST', success: function () { startCheckOrder(window.client_moniker, window.partner_order_id); + }, + error: function (jqXHR) { + let errorText = jqXHR.responseText; + let err = JSON.parse(errorText); + if(err){ + $('#errorMsgBox').text(err.message).show(); + } } }) }; From 60a5178c9696afeebb2d88137bcbab48457fe792 Mon Sep 17 00:00:00 2001 From: AlanFenng Date: Fri, 10 Apr 2020 16:48:19 +0800 Subject: [PATCH 16/17] =?UTF-8?q?upgrade=20=E4=BC=98=E5=8C=96=E5=8D=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/css/cardpay.css | 24 ++++++++++++++++++- src/main/ui/static/css/qrpay.css | 3 ++- .../static/templates/payment/v1/card_pay.js | 5 ++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/ui/static/css/cardpay.css b/src/main/ui/static/css/cardpay.css index abb0b1b61..de5d4d11a 100644 --- a/src/main/ui/static/css/cardpay.css +++ b/src/main/ui/static/css/cardpay.css @@ -152,4 +152,26 @@ section.content { .qr-desc { display: none; } -} \ No newline at end of file +} + +@media (min-width: 768px) { + .dl-horizontal dd { + margin-left: 180px; + line-height: 32px; + } +} + +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 32px; + } +} + + diff --git a/src/main/ui/static/css/qrpay.css b/src/main/ui/static/css/qrpay.css index 9a81c46f5..4fe57737d 100644 --- a/src/main/ui/static/css/qrpay.css +++ b/src/main/ui/static/css/qrpay.css @@ -23,6 +23,7 @@ section.content { display: block; margin: 40px auto; background: #fff; + border-radius: 10px; overflow: visible; box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.30); } @@ -150,4 +151,4 @@ section.content { .qr-desc{ display: none; } -} \ 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 22cbcd1cd..95dfb5edc 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -22,7 +22,8 @@ $(function () { cardFrame.frameStyle = { width: '100%', height: '400px', - border: 'none' + border: 'none', + borderRadius: '10px' }; cardFrame.onError = function (msg) { $('#errorMsgBox').text(msg).show(); @@ -52,4 +53,4 @@ $(function () { checkOrderStd(); } -}); \ No newline at end of file +}); From 2867b8e7460b3e684eba09751dc5606a57d2d872 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 10 Apr 2020 18:00:05 +0800 Subject: [PATCH 17/17] =?UTF-8?q?add=20=E5=A2=9E=E5=80=BC=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B4=A2=E5=8A=A1=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../clearing/core/impl/CleanServiceImpl.java | 27 ++++++++++ .../manage/tradelog/beans/TradeLogQuery.java | 12 +++++ .../core/impls/TradeLogServiceImpl.java | 51 +++++++++++++----- .../manage/mappers/payment/OrderMapper.xml | 8 ++- .../mappers/payment/TransactionMapper.xml | 5 +- .../incremental_partner_invoice_gst.jasper | Bin 0 -> 84130 bytes .../jasper/partner_invoice_gst.jasper | Bin 80864 -> 80855 bytes .../jasper/partner_invoice_gst20200410.jasper | Bin 0 -> 80864 bytes src/main/ui/manage.html | 2 +- .../templates/settlement_transactions.html | 42 ++++++++++----- .../ui/static/menu/templates/main_menu.html | 2 +- .../templates/incremental_service.html | 4 +- .../templates/incremental_trade_logs.html | 21 ++++---- .../ui/static/templates/payment/v1/qrpay.js | 44 +++++++-------- 15 files changed, 154 insertions(+), 66 deletions(-) create mode 100644 src/main/resources/jasper/incremental_partner_invoice_gst.jasper create mode 100644 src/main/resources/jasper/partner_invoice_gst20200410.jasper diff --git a/pom.xml b/pom.xml index ac75bc895..1176eb0a5 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.1.3 + 2.1.4 UTF-8 1.8.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 5d48e8e1c..df8299a7b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -301,6 +301,14 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider } cleanLog.put("channels", channelsObj); cleanLog.put("client_moniker", client.getString("client_moniker")); + //跨境商城支持 +// JSONObject incremental = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); +// if (incremental != null) { +// cleanLog.put("incremental_rate", incremental.getBigDecimal("incremental_rate_value")); +// cleanLog.putAll(incrementalAnalysisTransLogs(transactions)); +// BigDecimal royalpayTax = cleanLog.getBigDecimal("tax_amount").subtract(cleanLog.getBigDecimal("incremental_tax")); +// cleanLog.put("royalpay_tax", royalpayTax.setScale(2, RoundingMode.HALF_UP)); +// } return cleanLog; } @@ -1714,4 +1722,23 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider notices.add(new TodoNotice("settlement", settleDateSettingMsg, "#/analysis/clearing_logs/date_setting")); } } + + private JSONObject incrementalAnalysisTransLogs(List logs) { + final JSONObject analysis = new JSONObject(); + analysis.put("real_royalpay_charge", logs.parallelStream() + .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge"))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("incremental_charge", logs.parallelStream() + .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge"))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("incremental_tax", logs.parallelStream() + .filter(log -> StringUtils.equalsIgnoreCase("RP跨境商城", log.getString("source"))) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge")).divide(new BigDecimal(10), 2, RoundingMode.HALF_UP)) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + return analysis; + } + + private BigDecimal getSymbol(JSONObject log) { + return "Credit".equals(log.getString("transaction_type")) || "Settlement".equals(log.getString("channel")) ? BigDecimal.ONE : BigDecimal.valueOf(-1); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java index 0df88e908..1cfccc151 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java @@ -38,6 +38,7 @@ public class TradeLogQuery { private int group_bd; private String org_id; private String org_id2; + private boolean onlyIncrementAmount = false; public Integer getGatewayChild() { return gatewayChild; @@ -105,6 +106,9 @@ public class TradeLogQuery { if (StringUtils.isNotEmpty(org_id2)) { params.put("org_id2", org_id2); } + if (onlyIncrementAmount) { + params.put("onlyIncrementAmount", "1"); + } return params; } @@ -252,4 +256,12 @@ public class TradeLogQuery { public void setSource(String source) { this.source = source; } + + public boolean isOnlyIncrementAmount() { + return onlyIncrementAmount; + } + + public void setOnlyIncrementAmount(boolean onlyIncrementAmount) { + this.onlyIncrementAmount = onlyIncrementAmount; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index aeb24fa8c..670392a95 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -63,10 +63,7 @@ import org.springframework.ui.Model; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; +import java.io.*; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DateFormat; @@ -137,6 +134,8 @@ public class TradeLogServiceImpl implements TradeLogService { // @Value("classpath:/jasper/trans_flow_new.jasper") @Value("classpath:/jasper/partner_invoice_gst.jasper") private org.springframework.core.io.Resource trans_flow; + @Value("classpath:/jasper/incremental_partner_invoice_gst.jasper") + private org.springframework.core.io.Resource incremental_trans_flow; @Value("classpath:/jasper/royalpay_logo.png") private org.springframework.core.io.Resource logo; @Value("classpath:/jasper/trans_excel.jasper") @@ -256,13 +255,6 @@ public class TradeLogServiceImpl implements TradeLogService { if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role")) && !ManagerRole.ORG_MANAGER.hasRole(manager.getIntValue("role"))) { params.put("bd_user", manager.getString("manager_id")); } - if (query.isOnlyGroup() && ManagerRole.BD_LEADER.hasRole(manager.getIntValue("role"))) { - params.remove("bd_user"); - params.put("bd_group", manager.getString("manager_id")); - if (query.getGroup_bd() > 0) { - params.put("bd_group_bd", query.getGroup_bd()); - } - } orgManager.checkOrgIds(manager, params); if (query.getGatewayChild() != null) { params.put("trade_type", new ArrayList() {{ @@ -624,6 +616,20 @@ public class TradeLogServiceImpl implements TradeLogService { .filter(log -> log.getBigDecimal("settle_amount") != null) .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge"))) .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("total_royalpay_fee", logs.parallelStream() + .filter(log -> log.getBigDecimal("settle_amount") != null) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("royal_surcharge") + .add(log.getBigDecimal("surcharge_cashback")) + .add(log.getBigDecimal("channel_surcharge")))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("total_incremental_surcharge", logs.parallelStream() + .filter(log -> log.getBigDecimal("settle_amount") != null) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge"))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); + analysis.put("total_incremental_tax", logs.parallelStream() + .filter(log -> log.getBigDecimal("settle_amount") != null) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("incremental_surcharge").divide(new BigDecimal(10), 2, RoundingMode.HALF_UP))) + .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); analysis.put("total_surcharge", logs.parallelStream() .filter(log -> log.getBigDecimal("settle_amount") != null) .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount")))) @@ -696,7 +702,25 @@ public class TradeLogServiceImpl implements TradeLogService { parmerters.put("jd_fee", takeDecimalOrDefault(analysis, "jd_fee", BigDecimal.ZERO)); parmerters.put("alipay_online_fee", takeDecimalOrDefault(analysis, "alipay_online_fee", BigDecimal.ZERO)); parmerters.put("gst", takeDecimalOrDefault(analysis, "tax_amount", BigDecimal.ZERO)); + parmerters.put("royalpay_fee", takeDecimalOrDefault(analysis, "total_royalpay_fee", BigDecimal.ZERO)); + parmerters.put("incremental_fee", takeDecimalOrDefault(analysis, "total_incremental_surcharge", BigDecimal.ZERO)); + parmerters.put("incremental_gst", takeDecimalOrDefault(analysis, "total_incremental_tax", BigDecimal.ZERO)); + parmerters.put("royalpay_gst", analysis.getBigDecimal("tax_amount").subtract(analysis.getBigDecimal("total_incremental_tax")).setScale(2,RoundingMode.HALF_UP)); + dataList.parallelStream().forEach(item -> { + BigDecimal incrementalSurcharge = item.containsKey("incremental_surcharge") ? item.getBigDecimal("incremental_surcharge") : BigDecimal.ZERO; + BigDecimal taxAmount = item.containsKey("tax_amount") ? item.getBigDecimal("tax_amount") : BigDecimal.ZERO; + BigDecimal royalpaySurhcarge = item.containsKey("royal_surcharge") ? item.getBigDecimal("royal_surcharge") : BigDecimal.ZERO; + BigDecimal surhcargeBack = item.containsKey("surcharge_cashback") ? item.getBigDecimal("surcharge_cashback") : BigDecimal.ZERO; + BigDecimal channelSurcharge = item.containsKey("channel_surcharge") ? item.getBigDecimal("channel_surcharge") : BigDecimal.ZERO; + BigDecimal incrementalTax = incrementalSurcharge.divide(new BigDecimal(10), 2, RoundingMode.HALF_UP); + BigDecimal royalpayTax = taxAmount.subtract(incrementalTax); + BigDecimal realRoyalpayCharge = royalpaySurhcarge + .add(surhcargeBack) + .add(channelSurcharge) + .add(royalpayTax); + item.put("incremental_surcharge", incrementalSurcharge.add(incrementalTax).setScale(2, RoundingMode.HALF_UP)); + item.put("real_royalpay_surcharge", realRoyalpayCharge.setScale(2, RoundingMode.HALF_UP)); scaleDecimalVal(item, "display_amount", item.getString("currency")); String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); scaleDecimalVal(item, "clearing_amount", platformCurrency); @@ -708,7 +732,10 @@ public class TradeLogServiceImpl implements TradeLogService { String fileName = client.getString("client_moniker") + "_" + parmerters.getString("dateRange").replaceAll("/", ""); response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); OutputStream outs = response.getOutputStream(); - byte[] bytes = JasperRunManager.runReportToPdf(trans_flow.getInputStream(), parmerters, jrDataSource); +// JSONObject clientIncrement = clientIncrementalMapper.findByClinetIdAndChannel(client.getIntValue("client_id"), "RP跨境商城"); + JSONObject clientIncrement = null; + InputStream jasper = clientIncrement == null ? trans_flow.getInputStream() : incremental_trans_flow.getInputStream(); + byte[] bytes = JasperRunManager.runReportToPdf(jasper, parmerters, jrDataSource); outs.write(bytes, 0, bytes.length); outs.flush(); outs.close(); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index 9cad5b62b..c186147d4 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -363,7 +363,7 @@ AND p.client_id = #{client_id} - LEFT JOIN pmt_transactions t + INNER JOIN pmt_transactions t ON t.order_id = o.order_id AND t.refund_id IS NULL AND t.transaction_type = 'Credit' @@ -391,6 +391,9 @@ AND t.system_transaction_id = #{search_text} + + AND t.incremental_surcharge >0 + AND p.org_id = #{org_id} @@ -668,6 +671,9 @@ and o.create_time < #{to} and date(o.create_time)=date(#{date}) and binary o.dev_id=#{dev_id} + + AND t.incremental_surcharge >0 + and o.status=#{std} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index d8785a7d8..a71c233a1 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1146,6 +1146,9 @@ + diff --git a/src/main/ui/static/templates/payment/v1/qrpay.js b/src/main/ui/static/templates/payment/v1/qrpay.js index d1c2fbef8..9d7996ae0 100644 --- a/src/main/ui/static/templates/payment/v1/qrpay.js +++ b/src/main/ui/static/templates/payment/v1/qrpay.js @@ -14,27 +14,27 @@ $(function () { window.redirect = redirect; } } - - if (window.disable_ws) { - setTimeout(checkStatus, 3000); - - } else { - - var sock = new SockJS('/register'); - var client = Stomp.over(sock); - client.connect({}, function () { - client.subscribe('/app/payment/orders/' + window.order_id, function (msg) { - var json = JSON.parse(msg.body); - var concat = '?'; - if (window.redirect.indexOf('?') > 0) { - concat = '&'; - } - location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign; - }) - },function () { - setTimeout(checkStatus, 3000); - }) - } + setTimeout(checkStatus, 3000); + // if (window.disable_ws) { + // + // + // } else { + // + // var sock = new SockJS('/register'); + // var client = Stomp.over(sock); + // client.connect({}, function () { + // client.subscribe('/app/payment/orders/' + window.order_id, function (msg) { + // var json = JSON.parse(msg.body); + // var concat = '?'; + // if (window.redirect.indexOf('?') > 0) { + // concat = '&'; + // } + // location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign; + // }) + // },function () { + // setTimeout(checkStatus, 3000); + // }) + // } function checkStatus() { $.ajax({ url: 'status', @@ -54,4 +54,4 @@ $(function () { } }) } -}); \ No newline at end of file +});