From f6c3bd58f44cc9cc52d6fbd5b9414ad8d10c855c Mon Sep 17 00:00:00 2001 From: yevheniifedorus <yevheniifedorus@gmail.com> Date: Tue, 8 Dec 2020 15:58:59 +0200 Subject: [PATCH 1/3] logs fo js --- js/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/index.js b/js/index.js index 18f21d0..8eb6fcb 100644 --- a/js/index.js +++ b/js/index.js @@ -56,6 +56,8 @@ $(() => { const {settings} = payment const {mode, fee_mode, payment_token} = settings + console.log('settings ->', settings) + const { token, api_url } = parseJwt(payment_token) const getFormLinkObj = { @@ -132,7 +134,9 @@ $(() => { }) function parseJwt (token) { + console.log('token ->' ,token) const base64Url = token.split('.')[1]; + console.log('base64Url ->', base64Url) const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); const jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); -- GitLab From e3dbf1e429411f0df1fbdc9ff54ac4fd1644e549 Mon Sep 17 00:00:00 2001 From: yevheniifedorus <yevheniifedorus@gmail.com> Date: Tue, 8 Dec 2020 16:04:23 +0200 Subject: [PATCH 2/3] fix get link query --- js/index.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/js/index.js b/js/index.js index 8eb6fcb..19b630f 100644 --- a/js/index.js +++ b/js/index.js @@ -60,16 +60,9 @@ $(() => { const { token, api_url } = parseJwt(payment_token) - const getFormLinkObj = { - amount: order_amount, - mode: mode === 'T' ? 'DEV' : 'PROD', - token - } - $.ajax({ - url: api_url, - type: 'post', - data: getFormLinkObj, + url: `${api_url}?amount=${order_amount}&mode=${mode === 'T' ? 'DEV' : 'PROD'}&token=${token}`, + type: 'get', success: function (data) { let url = data url = `${url}${order_id ? `&orderId=${order_id}` : ''}`; @@ -134,9 +127,7 @@ $(() => { }) function parseJwt (token) { - console.log('token ->' ,token) const base64Url = token.split('.')[1]; - console.log('base64Url ->', base64Url) const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); const jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); -- GitLab From 5ecf8c24a6373c33c173b4f1e50e3ef41b210156 Mon Sep 17 00:00:00 2001 From: yevheniifedorus <yevheniifedorus@gmail.com> Date: Tue, 8 Dec 2020 16:05:38 +0200 Subject: [PATCH 3/3] fix get link query --- js/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/index.js b/js/index.js index 19b630f..a08aaba 100644 --- a/js/index.js +++ b/js/index.js @@ -56,8 +56,6 @@ $(() => { const {settings} = payment const {mode, fee_mode, payment_token} = settings - console.log('settings ->', settings) - const { token, api_url } = parseJwt(payment_token) $.ajax({ -- GitLab