#dai_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1234927742148149288
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! You can use the test Payment Methods we have on https://docs.stripe.com/testing (make sure you switch to the PaymentMethods tab).
Hello! Thanks for that - just to be clear would that mean if I were to implement via the API,
stripe.paymentMethods.attach('pm_card_visa', 'cus_321');
Yep, you could do that, although we strongly recommend against directly attaching Payment Methods like that.
You should use a Setup Intent or a Payment Intent with setup_future_usage instead.
Ah and with that option, that would automatically attach the test payment method to the customer?
Yep. If you're using Stripe Subscriptions the Subscription will create the Setup Intent or Payment Intent for you, depending on if a payment is due immediately or not.
Are you doing Subscriptions with trial periods or are you requiring payment immediately?
Both ๐ context is that I'm seeking to create some dev-tooling around setting up billing scenarios so both trialing and up-front-payments are what im looking to scaffold but i understand that choice implies whether looking at setup or payment intent on the subscription
When you create a Subscription that doesn't require an immediate payment it will have a pending_setup_intent you can use to set up a Payment Method for future use: https://docs.stripe.com/api/subscriptions/object#subscription_object-pending_setup_intent
When you create a Subscription that does require immediate payment it will create an Invoice, and the Invoice will have a Payment Intent with setup_future_usage enabled: https://docs.stripe.com/api/invoices/object#invoice_object-payment_intent
I see, thanks for all the resorces! I think i have what i need to continue exploring this now ๐