#andrei4002_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/1302968550306086933
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
thanks! a few more related questions, first, for the checkout option - will it automatically add all the available payment processors like apple pay, amazon, google etc if they are available?
for the invoice option, i guess it's the only other one that supports coupons, but is it related in any way to the other payment processors? what would be my options for the frontend part?
thanks! a few more related questions, first, for the checkout option - will it automatically add all the available payment processors like apple pay, amazon, google etc if they are available?
yes
for the invoice option, i guess it's the only other one that supports coupons, but is it related in any way to the other payment processors? what would be my options for the frontend part?
you would use the underlying PaymentIntent'sclient_secretwith the PaymentElement
okay, the payment intent approach seems a bit more involved, not sure if i got it correctly - for using the PaymentElement and having the coupon functionality, i should have a self-hosted form where i show the user an option to submit the coupon code (this is something not part of PaymentElement), and on the backend i should create some Stripe::InvoiceItem(s) (ruby) and a Stripe::Invoice, which will have an underlying payment intent setup?
yes exactly
by expanding on the payment_intent you will get the client_secret that you need to return to your frontend to use it
to confirm the payment
and for Checkout you can use the Embedded form which is a lot easier to integrate with and would be part of your website instead of redirecting to a Stripe-hosted checkout page https://docs.stripe.com/payments/checkout/how-checkout-works?payment-ui=embedded-form
sounds good, thanks! got one last question more related with the invoices, from what i saw you can't setup an invoice with specific invoice items, it kind of picks up the items that have been created and not paid for yet. I'm thinking of weird cases like when you create some items and don't finalize them for some reason, and maybe later you create other items, and want to finalize/pay those instead with an invoice. would the invoice pick up the old items as well? did i get this right? and would that mean from a dev perspective that i should make sure i manage those invoice items (ie remove old ones)?
sounds good, thanks! got one last question more related with the invoices, from what i saw you can't setup an invoice with specific invoice items, it kind of picks up the items that have been created and not paid for yet
it depends on which API version you're using
if you're using API version https://docs.stripe.com/upgrades#2022-08-01 and later then you would start by creating the invoice and then add the invoice items to it
oh, and when you create the item, you set the invoice param on it
okay, that's perfect, thank you so much!
sure thing let me know if you need any more help
i guess if im gonna be using the "collect the coupon myself" approach, i'm also responsible for calculating the estimated amount on the invoice to show to the user after he enters it? or is it something like i can apply the coupon to the invoice and then pull the final amount from the invoice if the coupon is valid for items in the invoice ?
i guess if im gonna be using the "collect the coupon myself" approach, i'm also responsible for calculating the estimated amount on the invoice to show to the user after he enters it?
no you can pass the coupon ID as a discount to the invoice
and then ask the invoice for the discounted / final amounts ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
when you pass the discount the invoice calculates the total for you
okay, sounds good, thanks!