Stripe v3 - Duplicate customer creation in Stripe for purchases after subscription

I am using the Stripe plugin (v3) to accomplish two main tasks:

  1. Charge the user for a subscription when they sign up with the application
  2. Charge the user on-session for in-app purchases

Both use cases are working fine with the exception that they create duplicate customer accounts with identical customer data (except for the customer ID obviously).

Use case 2. cannot happen without 1.

Some more details on how each of them work:

  1. Subscription creation - the pricing table is setup in my app’s sign up flow to pass through a client reference id which is the user’s unique ID. **This creates a new customer (customer_a)**After that, a webhook in stripe is listening for session checkout events and when it finds one, then it triggers a backend workflow in Bubble to update the user with the subscription id, customer id, price id, plan name, etc.

  2. In app purchases - When I try to “Charge an existing user’s CC” for a user that has already created a subscription then I get an error that the user has not setup a credit card. When I try to “Charge the current user”, then the user is prompted to enter their billing details again and is successfully charged. This create a new customer, (customer_b) All subsequent in-app purchases are successful when charging the current user because they charge customer_b’s account successfully from there on out.

I want to figure out a way for the in-app purchases to recognize the existing user that has a subscription.

I have already tried to have a subscription with and without a free trial as well so that was not the issue.

1 Like