From d608fd93964e235d10dec085dae85f2d33e7417a Mon Sep 17 00:00:00 2001 From: ugwumadu116 Date: Mon, 20 Dec 2021 12:52:38 +0100 Subject: [PATCH 1/2] fix multiple callback response --- dist/index.es.js | 2 ++ dist/index.js | 2 ++ example/src/App.js | 17 +++++++++++++++-- example/src/dist/index.es.js | 2 ++ example/src/dist/index.js | 2 ++ src/closeModal.tsx | 2 ++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dist/index.es.js b/dist/index.es.js index 9d5a714..b1c67b4 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -218,6 +218,8 @@ var FlutterWaveButton = function (_a) { function closePaymentModal() { document.getElementsByName('checkout').forEach(function (item) { item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + item.setAttribute('id', 'flwpugpaidid'); + item.setAttribute('src', 'https://checkout.flutterwave.com/?'); document.body.style.overflow = ''; }); } diff --git a/dist/index.js b/dist/index.js index c7757a2..1a3ac0e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -222,6 +222,8 @@ var FlutterWaveButton = function (_a) { function closePaymentModal() { document.getElementsByName('checkout').forEach(function (item) { item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + item.setAttribute('id', 'flwpugpaidid'); + item.setAttribute('src', 'https://checkout.flutterwave.com/?'); document.body.style.overflow = ''; }); } diff --git a/example/src/App.js b/example/src/App.js index 26297a5..ab71c9b 100644 --- a/example/src/App.js +++ b/example/src/App.js @@ -4,7 +4,7 @@ import { useFlutterwave, FlutterWaveButton, closePaymentModal } from './dist/ind export default function App() { const config = { - public_key: 'FLWPUBK-**************************-X', + public_key: "FLWPUBK-**************************-X", tx_ref: Date.now(), amount: 10, currency: 'NGN', @@ -46,6 +46,19 @@ export default function App() { onClick={() => { handleFlutterPayment({ callback: (response) => { + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") + console.log(" response") console.log(response); closePaymentModal() @@ -60,7 +73,7 @@ export default function App() { Testing FW Payment - + {/* */} ); } \ No newline at end of file diff --git a/example/src/dist/index.es.js b/example/src/dist/index.es.js index 9d5a714..b1c67b4 100644 --- a/example/src/dist/index.es.js +++ b/example/src/dist/index.es.js @@ -218,6 +218,8 @@ var FlutterWaveButton = function (_a) { function closePaymentModal() { document.getElementsByName('checkout').forEach(function (item) { item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + item.setAttribute('id', 'flwpugpaidid'); + item.setAttribute('src', 'https://checkout.flutterwave.com/?'); document.body.style.overflow = ''; }); } diff --git a/example/src/dist/index.js b/example/src/dist/index.js index c7757a2..1a3ac0e 100644 --- a/example/src/dist/index.js +++ b/example/src/dist/index.js @@ -222,6 +222,8 @@ var FlutterWaveButton = function (_a) { function closePaymentModal() { document.getElementsByName('checkout').forEach(function (item) { item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + item.setAttribute('id', 'flwpugpaidid'); + item.setAttribute('src', 'https://checkout.flutterwave.com/?'); document.body.style.overflow = ''; }); } diff --git a/src/closeModal.tsx b/src/closeModal.tsx index c34ea0e..64bab6a 100644 --- a/src/closeModal.tsx +++ b/src/closeModal.tsx @@ -5,6 +5,8 @@ document.getElementsByName('checkout').forEach(item => { item.setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + item.setAttribute('id','flwpugpaidid'); + item.setAttribute('src','https://checkout.flutterwave.com/?') document.body.style.overflow = ''; }) From 06aa65cf65144363cc2155fda32f69ef3814ee47 Mon Sep 17 00:00:00 2001 From: ugwumadu116 Date: Mon, 20 Dec 2021 13:05:19 +0100 Subject: [PATCH 2/2] remove unwanted log --- example/src/App.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/example/src/App.js b/example/src/App.js index ab71c9b..2e45050 100644 --- a/example/src/App.js +++ b/example/src/App.js @@ -46,19 +46,6 @@ export default function App() { onClick={() => { handleFlutterPayment({ callback: (response) => { - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") - console.log(" response") console.log(response); closePaymentModal() @@ -73,7 +60,7 @@ export default function App() { Testing FW Payment - {/* */} + ); } \ No newline at end of file