react-paystack icon indicating copy to clipboard operation
react-paystack copied to clipboard

close paystack popup

Open AltaRosso opened this issue 3 years ago • 10 comments

First of all, great package. Thanks!

I have a small problem and I am struggling to find a way around it. I am using the PaystackButton, after the popup opens, the background color is white and the users will not be able to see the close icon on the top right corner of the popup to CLOSE the popup if ever they choose not to continue with payment.

Could you please tell me a work around this or if possible, change it on your side.

Much appreciated, Thanks. close popup

AltaRosso avatar May 08 '23 12:05 AltaRosso

@AltaRosso were u able to find a workaround?

usmangurowa avatar Feb 21 '24 19:02 usmangurowa

This issue was open almost a year ago, i think it should be given some attention.

usmangurowa avatar Feb 22 '24 08:02 usmangurowa

@usmangurowa I don't remember how I did it exactly but if I remember correctly, I changed the background colour of that page. Try that.

AltaRosso avatar Feb 22 '24 09:02 AltaRosso

Not sure i follow, changed the background color of the current page i am using the paystack on? Care to share like a code snippet or something?

usmangurowa avatar Feb 22 '24 09:02 usmangurowa

I'll try to retrieve the project. I stopped working on it, a year ago. I'll share once I get it up and running.

AltaRosso avatar Feb 22 '24 14:02 AltaRosso

Okay, thanks.

usmangurowa avatar Feb 22 '24 16:02 usmangurowa

@usmangurowa Could you please share your code snippet. It might help jog my memory.

I managed to get the project running - see screenshot: Screenshot 2024-02-22 231528

AltaRosso avatar Feb 22 '24 21:02 AltaRosso

@usmangurowa I think I got it - it seems like I ended up using the API https://paystack.com/docs/api/transaction/#initialize

const params = JSON.stringify({ //other fields ... email: user.email, callback_url: "http://localhost:3000/paystack/payment", }); await axios.post("https://api.paystack.co/transaction/initialize", params, { headers, }) .then(async (response) => { console.log(response.data.data); })

The response includes the authorization url, which is the checkout page.

Let me know if this works for you.

AltaRosso avatar Feb 22 '24 22:02 AltaRosso

@AltaRosso thanks man, will give it a try.

usmangurowa avatar Feb 23 '24 08:02 usmangurowa

I think it's a business move, so people can cancel, but that's not really ethical! I hope they make the changes necessary.

micwise17 avatar Apr 15 '26 05:04 micwise17