Home > Mobile >  Integrating Paypal with Flask
Integrating Paypal with Flask

Time:10-10

Please, I've been trying to integrate paypal with flask. I've read the docs and basically all guides I've searched out for are outdated. I copied the checkout code here then updated my key but yet, it loads but then keeps loading till forever. And please I work only with Python, so I guess it's throwing an error of returning promise... but i'm not really sure of what to do. Please I need help.

CodePudding user response:

I am learning python too and doing same paypal integration. Right now I am on a stage that payment works.

In sandbox of paypal you set two types of accounts: business and personal. In Business you integrate it with your app by clicking on three dots ... . This will open parameters and on top, select API Credentials. Inside API Credentials on a bottom, select your app-name (that you have created) Then in a new window check your Client ID. (copy it)

Replace test with your Client ID in html code (https://developer.paypal.com/docs/checkout/standard/integrate/):

<script src="https://www.paypal.com/sdk/js?client-id=TEST&currency=USD"></script>

It should work. But now my question is ... how to get inside my route in flask/python some details from that payment? Successful or not etc

CodePudding user response:

It keeps loading in a new screen (with paypal window), right? Just switch back to your original screen. Yuu will see a javascript alert message on top, with payment status. Once you click ok, your other window with padlock will disappear too.

  • Related