Anvil includes Stripe functionality, so I’m assuming it also includes the Stripe Javascript on the client side.
I’m trying to access the Stripe Javascript directly, though, and getting the message that Stripe is not defined.
My case is that I’m trying to redirect the user to an abandoned Stripe Checkout session from within an Anvil form.
Edit: I do have the Stripe service added to the Anvil app, but have not connected the Stripe service to my Stripe account (since all I need is the Javascript available).
You’re right that the Stripe client is included in the front-end code of your Anvil app. In particular, we load https://checkout.stripe.com/checkout.js. This defines at least StripeButton and StripeCheckout, which work when I try them. Are you seeing something different?
Hi @jshaffstall. Were you able to access stripe.redirectToCheckout on the client side?
I am able to successfully get a sessionId from Stripe’s servers (through a server call), but I can’t seem to access stripe.redirectToCheckout on the client side to use Stripe’s new built-in Checkout page.
I’ve added <script src="https://js.stripe.com/v3/"></script>
to my Native Library in Anvil.