Stripe.js card token not generated quick enough to build card

Hi all,

has anyone overcome the issue of tokenisation with the stripe.js plugin; the create a card process is falling down due to the source (ie. step 3 in workflow screenshot) not being available as the card token from step 1 (the stripe token element) is often not created in time to pull.

i can’t quite figure out how to get this to progress consistently but am sure there is a fairly simple solution for this?

cheers,
Ben

Yep, same thing happening to me as well. Stripe.js just sucks. Please let me know if you figured this out! Thanks!

I think I might have figured it out.

watch the beginning portion of the video above.

You need two workflows

Convert Card to Token when a button is clicked

Then another custom event where when that token is created, > create card, update user, etc.

1 Like

This is correct.

This is not down to the plugin design by the way, this is just how these types of asynchronous processes work. Your first workflow will trigger a call to Stripe who will reply with data needed for Part II… but this happens out of sequence of your workflow and it’s not known how long the reply will take. Your workflow always works in sequence though and it just powers on.

Meanwhile the plugin is listening for the response from Stripe, and when it gets it the event is triggered, so that you can pick up where you left off with a second workflow.

Thanks Edward.

Would you happen to know the best practice for tagging users as members who’s paying for a subscription? I am wondering if it’s some sort of checking if the user’s CC is not deleted in stripe or anything when they log in?

Thank you

I’m not 100% sure I am afraid but others likely will.

I have done once before but it was a while back… from memory I was using the charge.succeeded event within the Stripe API to send a call to and endpoint in the Bubble App’s API… and this extended the customers ‘expiry’ date by another month within the database.

This date was then used on login, checking that the current date was within the user’s expiry date.

1 Like