Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
273 stars 81 forks source link

[QUESTION] How do I know if the payment is loading? #61

Open ceciliamzayek opened 4 years ago

ceciliamzayek commented 4 years ago

I am trying to use the paypal button for payments on my website, and I have two issued regarding loading.

  1. When the component is loading, the first button "pay with paypal" loads first, and the "pay with credit card" takes a while to fully display with text on it. If I click on "pay with credit card" before it is fully loaded, it opens the paypal page. I tried creating a "loading" state boolean, that I set to false when "onButtonReady" is called, but this does not work, as it seems to be considered "ready" once the paypal button is ready. Is there a way around this?

  2. Once the payment is done, we get a loading spinner on the paypal component, however, it then turns back to the black "payment by card" button for a few seconds before the "onSuccess" is called. This can be confusing for users as they will think it has finished loading, but it is in fact still loading (I do a redirect on Success and it isn't immediate because of this). How can I handle it in a user-friendly way?

ertemishakk commented 4 years ago

@ceciliamzayek have you found anything to work around this?

ceciliamzayek commented 4 years ago

@ertemishakk no :( I moved on to another provider as the rates were cheaper

MihaiWill commented 4 years ago

@ertemishakk no :( I moved on to another provider as the rates were cheaper

Which one please?

Also, have someone find a solution for this?

ceciliamzayek commented 4 years ago

@ertemishakk no :( I moved on to another provider as the rates were cheaper

Which one please?

Also, have someone find a solution for this?

Stripe