piyushgarg-dev / react-razorpay

Integrate Razorpay payments in your React App
https://www.npmjs.com/package/react-razorpay
20 stars 4 forks source link

Add a flag to useRazorpay response to indicate if the script has loaded #4

Closed azizmb closed 1 year ago

azizmb commented 1 year ago

This allows for triggering the modal on page load, using something like:

  useEffect(() => {
    if (isLoaded) {
      handlePayment();
    }
  }, [isLoaded, handlePayment]);
BlitzJB commented 1 year ago

This'd be super useful, pl do review and merge @piyushgarg-dev @siddiquiaffan

This is really the only thing stopping me from using this in production, in our implementation we use useScript from https://usehooks.com/

piyushgarg-dev commented 1 year ago

Hi @BlitzJB, I had reviewed this earlier but forgot to merge this PR 😄

BlitzJB commented 1 year ago

Thanks a lot @piyushgarg-dev i have never been responded to in 3 minutes lol. Just texted my team, we'll be using this in production for a client we are onboarding right now. We'll let you know how that goes. in the meantime, you should really put up a donation link on the repo. We'll probably come around ourself to appreciate the work you've done

BlitzJB commented 1 year ago

Also, can this also be published onto npm? would be convenient to not have to find the github link everytime

piyushgarg-dev commented 1 year ago

Yes @BlitzJB, Already did that 😄 Screenshot 2023-07-13 at 3 11 17 PM

siddiquiaffan commented 1 year ago

This'd be super useful, pl do review and merge @piyushgarg-dev @siddiquiaffan

This is really the only thing stopping me from using this in production, in our implementation we use useScript from https://usehooks.com/

@BlitzJB Thanks for the mention! Looks like the issue is already resolved. If there's still something, please let me know I would more than happy to help! I'm also looking for development collaboration.