Using the native Stripe library

I’m starting to try to integrate Stripe payments into my project, and wanted to play with using the native Stripe API. In this post, Stripe payment subscriptions , the use of raw=True on get_token was recommended to get a token associated with my account, not Anvil’s account.

When I use this code in a form:

token, info = stripe.checkout.get_token(amount=total, currency="USD", raw=True)

Nothing happens. If I leave off the raw-True then it works as I’d expect, with the Stripe window coming up and the token and info getting returned.

Has anyone used raw=True before with success?

I was able to get raw=True on get_token to work successfully in a test app and completed a charge through the native Stripe API. So it does work, I’ll just need to debug more on my actual app to find out why it isn’t working there.