#bruno_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ 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/1212396615873204315
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ 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. Thank you for your patience!
Full code, since it won't fit into the form:
return await stripe.subscriptions.create({
customer: customerId,
items,
payment_behavior: 'default_incomplete',
payment_settings: { save_default_payment_method: 'on_subscription' },
expand: ['latest_invoice.payment_intent', 'pending_setup_intent'],
automatic_tax: { enabled: true },
});
Hi, let me help you with this.
Could you please share the error Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Hey, sure, just one sec
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Currently, we get customer billing information on the payment step, using PaymentElement:
But since we need to create a subscription to then generate a payment intent, we are not sure how to store the location before making the POST v1/subscription call
Yes, I understand. What you can do here is collect payment/billing details before creating the Subscription. The article is about creating the PaymentIntent, but the principle is the same: https://docs.stripe.com/payments/accept-a-payment-deferred
๐ the doc @cobalt dagger shared also has a section for subscriptions flow which is what you'd need
Here's a deeplink: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
Hey, thank you for the feedback.
That's exactly what we do at the moment:
- We create the customer
- We render the component to collect payment details
- We create a subscription that will be treated as
incompleteby stripe - The front-end uses the payment intent to use payment details to charge the customer
But when we try to create the subscription on step #3 without having a card linked to the customer, after adding the automatic_tax flag, it fails, since Stripe hasn't received the card details yet
The flow we linked above collects the PaymentMethod details without requiring an Intent
Step 3 is where you collect the payment method details and tokenize it.
Step 7 is where you confirm the subscription (where the payment method gets charged)
Ah, perfect!
I couldn't find on the documentation the call we use to "tokenize" the payment method on step 3... Here we are not sending that data to the back-end, are we?
You're not sending it to your backend, no.
But if you're listening to Webhook events then you'd likely receive appropriate events.
Ah, sorry. When i said back-end I meant sending the data to Stripe.
Here we are just rendering the component from what I understood, but where to we generate a payment method?
Submitting the element sends the payment method info to Stripe and creates a PaymentMethod