From 4b5d8c60dafb5ffbb9c29d757133522e02cdc8f4 Mon Sep 17 00:00:00 2001 From: anamotaadyen Date: Thu, 6 Oct 2022 19:54:40 +0100 Subject: [PATCH] fixing payment call --- app/main/payments.py | 4 +++ app/static/css/application.css | 7 ++++- app/static/js/adyen-implementation.js | 40 +++++++++++++++------------ app/templates/component.html | 8 ++++-- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/app/main/payments.py b/app/main/payments.py index 7892350..9af7e07 100644 --- a/app/main/payments.py +++ b/app/main/payments.py @@ -137,6 +137,10 @@ def currency_locale(country): def sanatizeRequest(payments_request): del payments_request['locale'] del payments_request['currency'] + del payments_request['city'] + del payments_request['houseNumberOrName'] + del payments_request['postalCode'] + del payments_request['street'] # loaded = json.loads(payments_request) # for item in loaded: diff --git a/app/static/css/application.css b/app/static/css/application.css index f7de689..a4c66a0 100644 --- a/app/static/css/application.css +++ b/app/static/css/application.css @@ -632,7 +632,8 @@ a:hover { :root { --background-color: purple; - --button-edges: 25px; + --button-edges: 10px; + --body-edges: 10px; } @@ -640,5 +641,9 @@ a:hover { background: var(--background-color) !important; border-radius: var(--button-edges) !important; } + + .adyen-checkout__payment-method { + border-radius: var(--body-edges) !important; + } /* Copy button */ diff --git a/app/static/js/adyen-implementation.js b/app/static/js/adyen-implementation.js index 0ee316d..76fe08f 100644 --- a/app/static/js/adyen-implementation.js +++ b/app/static/js/adyen-implementation.js @@ -504,21 +504,21 @@ function handleServerResponse(res, dropin) { } // Test cards JS -function copyToClipboard() { - // Get the text field - let copyPAN = document.getElementById('cardNumber').textContent; - console.log(copyPAN) +// function copyToClipboard() { +// // Get the text field +// let copyPAN = document.getElementById('cardNumber').textContent; +// console.log(copyPAN) - // Select the text field - // copyPAN.select(); - // copyPAN.setSelectionRange(0, 99999); // For mobile devices +// // Select the text field +// // copyPAN.select(); +// // copyPAN.setSelectionRange(0, 99999); // For mobile devices - // Copy the text inside the text field - navigator.clipboard.write(copyPAN); +// // Copy the text inside the text field +// navigator.clipboard.write(copyPAN); - // Alert the copied text - alert("Copied the text: " + copyPAN); -} +// // Alert the copied text +// alert("Copied the text: " + copyPAN); +// } let r = document.querySelector(':root'); function setDynamicCSS() { @@ -531,19 +531,25 @@ function buttonEdges () { r.style.setProperty('--button-edges', pixelVal); } +function bodyEdges () { + let bodyEdgeValue = document.getElementById('bodyEdges').value + let bodyPixelVal = bodyEdgeValue + 'px' + r.style.setProperty('--body-edges', bodyPixelVal); +} + function resetDynamicCSS () { r.style.setProperty('--background-color', null); } - - -initCheckout(); - - // Copy to clipboard function function copyToClipboard(e) { const cb = navigator.clipboard; cb.writeText(e.target.innerText) } + +initCheckout(); + + + diff --git a/app/templates/component.html b/app/templates/component.html index 24c5a00..1aea906 100644 --- a/app/templates/component.html +++ b/app/templates/component.html @@ -100,8 +100,12 @@
- - + + +
+
+ +