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.