Stripe.js Successful Payments - Figured it out

I’ve been struggling to figure out how to trigger an event when a payment is successful using the Stripe.js Plugin.

For those using the plugin, with the same issue, I hope this is helpful.

Note I’ve tried a lot of things - Copilot (the plugin developer) recommended in a thread to use the ChargeID’s (Generated from a Payment Intent action) to indicate success or failure…

The problem is that if it fails, I haven’t found out how to trigger an even using ChargeIDs.

Anyway - here is what I did…

This assumes:

  • You’re using payment intents
  • You’re confirming and capturing in a single action

On failure - The result of the payment intent actions client secret be empty, you can use this as a trigger to kick off failure events and actions.

On success - The result of the payment intent action will contain charge IDs. It’s a list so you should say “When charge IDs count > 0”

Hope this helps someone else out there getting a nose bleed trying to figure out how to get stripe and bubble to work in the most ideal way.

1 Like

Can this be used when using Bubble’s Stripe plugin as well? After “Charge current user” action, you can get the payment intent but i’m not quite sure how to get a confirmation from this to either proceed or terminate the workflow.

I don’t use the bubble native stripe plugin. But if memory serves me correctly, if the charge fails the workflow will stop. If the charge succeeds the workflow will continue.

Don’t quote me on that though, its just my fuzzy recollection of how it works (From a year+ ago)

I figured it out by using Stripe.js2’s plugin action “Retrieve a PaymentIntent”. Since Bubble’s Stripe has the capability to get the PaymentIntent, i used this action to confirm the payment Intent’s status and it works! Was able to confirm said payment