#jhonsalazar1623_best-practices
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/1232498554778550282
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
hello! I'm afraid that's not recommended. How have you currently integrated with Stripe to collect payment for subscriptions? Are you using Payment Element, or Checkout Sessions?
good question!
yes, Im using stripe element, in my current flow
all integration was done by code
frontend and backend
I use the invoice upcoming to calculate taxes automatically and total price, total tax, etc
the core logic of creating a one time payment is essentially the same, you would create a PaymentIntent and collect the payment details in the Payment Element for payment
These guides might be helpful, the below flows require creating a PaymentIntent first :
if you want to display the Payment Element without creating a PaymentIntent first, you can refer to the deferred flow :
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
My big problem is that the customer could buy a weekly subscription and a one-time payment subscription, with recurring price subscriptions I have no problem, I use confirmIntent
you can add the one-time payment to the subscription also : https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if i understand correctly, the customer needs to make payment for a Subscription, and a one-time item right?
Yes, also keep in mind that you could purchase other subscriptions at different intervals, for example weekly, monthly and then a one time payment. In that case I would be buying 3 products with different prices in a single transaction in my service.
you can't pay for 3 subscriptions with different intervals in the same payment
you'll need the customer to make payment separately for each of these subscriptions
so to summarize, you can combine a one-time payment with a subscription. However, you can't combine payments for different Subscriptions
they recommended me to do was to make a subscription payment through payment intent and then make the other payments automatically after having been successful in the first subscription.
how? what is the property to set up?
use add_invoice_items - you can either pass in a one-time Price object in add_invoice_items.price or create an ad-hoc Price using add_invoice_items.price_data
they recommended me to do was to make a subscription payment through payment intent and then make the other payments automatically after having been successful in the first subscription.
I don't recommend this method. For example, if 3DS is required, you are going to need the customer to authenticate again. The customer is going to be very confused if they have to do subsequent authentication, but have no visibility about what you're doing in the backend
ohh I understand
ohh, I will be working on it
Thanks!
it is use to invoice upComming also?
sorry, i don't understand?
ah ok
well, I use invoice up comming to calculate the total price, the total tax (it calculates it automatically) to run a summary to the customer before paying
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
alright, what's your question?
If this solution helps me to calculate invoice upcomming or if I have to be careful?'
if you want to add a one-time item in upcoming invoice, i believe it's here : https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-invoice_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you can try it out
ohh ok,