Hello there, I’am fairly new to Dash and have been working on a project for the last few weeks which requires a PayPal (Any Payment accepted) Button integration.
I have been trying to integrate
into the cookicutter template but as a total Noob on JS and the whole Node FW i am feeling a bit helpless. Has anybody ever done a comparable project or custom component which allows for Payment options ?
Kind regards, Thilo .
Did you manage to solve this?
Any updates on this topic?
I have no insight into implementing the paypal functionality as a custom component, but it is possible to render the button by adjusting Dash’s HTML Index Template (Adding CSS & JS and Overriding the Page-Load Template | Dash for Python Documentation | Plotly).
If you try to assign a Dash html.Div component the ID for the Smart Payment Buttons Integration, the js will not find it as the Dash Div component hasn’t rendered by the time the JS executes (someone can correct me if i’m wrong about this since my js knowledge isn’t that great). Therefore the button and js script need to be added outside of Dash by adjusting the HTML template. It is a little hacky but I believe it can work. I am working on a complete tutorial for how to implement paypal into a dash site. Hopefully will have it done soon since it seems like there is a desire for the knowledge!
I couldnt find an easy way to implement the JS PayPal quick button so I just used the API and created my own buttons. Maybe this tutorial will help?
Here is a simple implementation of the PayPal subscription functionality in a Dash App. Maybe it can be of some use? I use the Python paypal checkout SDK, but write two classes to use the subscription api. Then I implement a subscribe button that redirects the user through paypal to complete the transaction. Once logged back in, the user sees the subscriber view.
show-and-tell tag to this one