#_cho
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- _cho, 1 hour ago, 25 messages
- _cho, 22 hours ago, 15 messages
- cho-productcatalog-paymentintent, 1 day ago, 25 messages
- _cho, 1 day ago, 5 messages
Hi, what do you mean by 'without throwing error'?
oh, sorry I stepped away. I assumed if a discount was unredeemable for a user it would have an error message associated
My primary question just has to do with the automatic association of the discount <-> priceId of the product
rather than a discount <-> productId relationship
I see, what you're asking is not possible. However, you can add a restriction to the coupons, https://stripe.com/docs/billing/subscriptions/coupons#limit-by-customer if that is helpful.
ahh I see, I'll keep that in mind
Sure!
question
I am using stipe.js,
and I made an invoice, added an invoice item, and then invoked: await stripe.invoices.finalizeInvoice(invoice.id);
So I do:
const finalizedInvoice = await stripe.invoices.finalizeInvoice(invoice.id);
But then I check my finalizedInvoice status and it says open
I thought that it would say paid, since I finalized it
I see that it is in "PaymentIntent_status: requires_confirmation"
but is there a setting I need in order to change that, because I am just charging the customer there is no need to require confirmation
Can you share the request id with me? Is there a default payment method that is set on the customer? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request .
the request ID for the invoice finalization
in_1OejRrDyFtOu3ZuTdw5RCcNn
the payment intent Id: pi_3OejRsDyFtOu3ZuT1MVewC8C
oh you need the req_...
req_oqY4SHlgePNBAH
This works, taking a look here
hey, im really sorry if I messed something up, I went and did a test and accidentally paid the invoice
But I did see a message saying that the payment would automatically attempt in "47 minutes"
so I believe the auto_advance was waiting to charge the user's card
I was under the assumption that if I manual finalize it would also manual charge the payment intent
I was just going to say that the invoice looks to be paid now.
I would very much like the auto_advance system of automatic retries, but I would like for it to charge the payment intent immediately after generation of the invoice
Can you add more details to 'I was under the assumption that if I manual finalize it would also manual charge the payment intent?'
yes, so I understand that if I set auto_advance : true, then after approx 1 hour stripe will automatically handle the entire invoice + failures and whatnot
I was informed that I can do that and also do the finalization myself
I see, in this case, you can choose to send the invoice, https://stripe.com/docs/api/invoices/create#create_invoice-collection_method instead of charging the customer automatically.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so there is no way to automatically charge the card?
so my system is:
Customer makes setup_intent, we review the order, we approve of it, and then on approval if it is a 1-time purchase we generate an invoice, and then charge it immediately
My business logic requires me to get the status of the payment immediately after attempting to charge it.
So I have the payment_method_id the customer wants to use
okay!
Yes you can do the above, you would use the /pay API to finalize/pay immediately: https://stripe.com/docs/api/invoices/pay
ahh I see
so I would invoke in code - finalize, and then sequentially invoke pay
Like this
You don't even need the finalize call
The Pay API both finalizes and attempts payment
Sure thing
oh just a note, i'm sure you guys are the professionals but I did find that if I invoke the code I showed you
it won't attempt to pay the invoice
that's something interesting. Not a question, just found that interesting
Going to need more information
Did you see an error?
Is there a PaymentMethod set to charge?
yes, so I removed the line where I finalize the invoice and it works just liek you said it would
I get status = paid
but if I try to finalize, and THEN try to pay the invoice, I get status = open
in_1OejnRDyFtOu3ZuTRd7i0eeU
please note I was experimenting and I turned off automatic collection for this invoice
I don't see any attempted /pay request related to that Invoice
You can see the requests within the Logs section here: https://dashboard.stripe.com/test/invoices/in_1OejnRDyFtOu3ZuTRd7i0eeU
So maybe your code wasn't updated/saved at that point?
But yeah it would work if you did finalize and then pay in separate requests
Ahh I see. It is most likely that I did not update/save the code
๐