Firebase Stripe extension checkout link for user

Viewed 34

I installed Firebase stripe extension. Every time user is created, the extension creates stripeId.

I created buttons to buy subscription plans

<a class="btn btn-primary" href="https://buy.stripe.com/test_5kA8x65CAeF23Cg8ww" role="button">BASIC</a>
<a class="btn btn-primary" href="https://buy.stripe.com/test_7sI00A0igbsQ4Gk7st" role="button">Premium</a>

How to pass user stripeId in link, so Stripe knows which customers buy it?

Now even customer use the same email, Stripe creates new customer.

1 Answers

When using Payment Links, you can pass some URL parameters like client_reference_id and prefilled_email as mentioned in this doc. However this will still create a new customer object every time someone make a purchase.

If you want to reuse existing customer objects, you cannnot use Payment Links. Instead you should use Checkout Sessions and set the customer parameter.

Related