#lucid_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1259880373114896404
đ Have more to share? Add details, code, screenshots, videos, etc. below.
is anyone around?
Hello
When you say you subscribe a customer after payment is successful, are you calling /v1/subscriptions API?
That might explain why you're seeing two charges
yes
Subscriptions API charges the payment method on its own. You don't need a separate PaymentIntent to charge the payment method prior to creating the subscription
ok. here is a question. i set the products up in the 'products catalog' dash, they are set to be recurring. Does a single purchase of that product automatically set up a subscription?
What do you mean by single purchase in this context? What API would you use for that?
honestly, i was hoping you could help me figure that out
i can't seem to add a product to the intent, nor to the customer, so what is the process? don't do the intent and just set up the customer?
and then assign the subscription?
So what's the exact usecase? PaymentIntents API do not support line items (products created from dashboard). PaymentIntents API supports just passing an amount.
Is your goal to create the subscription after payment has been made?
And do you want to use your own UI for payment or any Stripe hosted UI works?
this is the problem. when i used my own UI i got the error telling me that sending card info was insecure, and it suggested using a stripe-based form - i switched to elements, but that sucks too because getting it to collect email and phone was a PITA.
I see. We don't allow using your own forms to accept card details for security concerns. You'd also need PCI compliance to do that.
So, I meant integrating something like PaymentElement in your web page which can securely collect the PaymentMethod details for you (which I think is what you're using right now)
https://docs.stripe.com/payments/payment-element
You could techinically add your own text fields to the page to collect the email and phone number & send it over when you call confirmPayment function..
An easier alternative would be to use Checkout Sessions API and let stripe handle mostly everything for you.
https://docs.stripe.com/billing/subscriptions/build-subscriptions
ok, but confirmPayment is confirming the card was charged, correct? that charge has no product and no customer attached to it
Correct but it also lets you pass in billing details for the PaymentMethod user is submitting.
https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data
We have a guide here which shows how you can collect PaymentMethod details without a PaymentIntent/SetupIntent & then create a subscription with that
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription