Stripe Elements integration - Possible to switch from a token to a source/customer?

We are currently processing charges via a stripe JS / elements form on our site. This works great for one-time charges, but we have a need as well to create customers and subscribe them to process subscriptions for auto-renewals.

Currently we have:

  • onFormLoad action that configures/draws the stripe element form
  • a window.stripe.createToken action tied to the pay button
  • a promise .then() action that sends the token data to FileMaker
  • a utility script in FileMaker that uses the token data to store the order data and charge/use the token.

This might not even be possible with elements, and we already have the ability to create stripe customer records from the filemaker side. It appears that creating a “source” instead of a “token” may be a way to go.

Suggestions are greatly appreciated.

If I’m understanding your need correctly, the story is:

“ A returning user needs to pay a recurring charge or subscription with a previously entered card. “

If this is correct, the first time you capture the card token you:

Call stripe to create the customer
Call stripe and attach the token as a payment source and make it the default

//for every payment needed
Call stripe and create a charge against the customer

Hth

I believe in Stripe, “tokens” are one-time use only, and can’t be attached at all. I believe “sources” can be attached, but I’m not sure that stripe elements can create sources.

This is for an annual subscription and there is a checkbox to opt-in for recurring yearly payment of member dues.

No, token are a representation of the card.

We do exactly this for BF subscriptions.
Capture card,
Create customer
Attach Token
Create charge or sub

Once set up, you can run a charge with the API