#boskiv
1 messages · Page 1 of 1 (latest)
Yep, I recommend using webhooks. You can listen for customer.subscription.created events and review details about the brand-new subscription
But that means I need extra backend to listen, parse events and map my user_id with stripe customer_id and subcription_id
I thoght it should be more easy way, just query Stripe API with customer email to get active subscription
Yep, that's correct. When a customer goes through the payment process, completing the payment will trigger the creation of a customer object. You would then have to listen for customer.subscription.created events then make a separate call to expand customer and inspect the email
I thoght it should be more easy way, just query Stripe API with customer email to get active subscription
Not by email, no, as emails are not unique on Stripe
You could list all subscriptions but would still need to filter by customer ID.
But how i can guarantee that subscription unique? I mean I have firebase users with email, I have no Stripe customer ID to map. Because I use payment links
It's not possible to do with Payment Links since these links aren't specific to a given customer. If you still want to use a Stripe-hosted way of accepting payments, I recommend using Checkout instead. Prior to creating a Checkout Session, you could create a Customer object for each email and keep track of the mapping between email and customer ID on your end
Then, create a Checkout Session for a given customer using their Stripe customer ID
😦
Payment Links use Checkout under the hood to accept payments. Checkout isn't no code though
Thanks
Sure thing!
Can you tell me can I disable payment in pricing table or payment link when offer trial ?
Just to be clear, you mean you'd like to allow a customer to subscribe and start with a free trial but not collect their payment details?
yes
I saw few blog posts where it possible to do with API, but curious about no-code solution
got it. no, there isn't a no-code solution at the moment. You can add a trial but payment details will always be collected with no-code solutions
If you create a PaymentLink via the API, you would use payment_method_collection: if_required and set subscription_data to include a trial: https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-payment_method_collection
Why i can't delete payment link. If I will play now with curl request i will have a tons of garbage in my account ?