#_cho

1 messages ยท Page 1 of 1 (latest)

drowsy dockBOT
#

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.

dull seal
#

Hi, what do you mean by 'without throwing error'?

primal birch
#

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

dull seal
primal birch
#

ahh I see, I'll keep that in mind

dull seal
#

Sure!

primal birch
#

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

dull seal
primal birch
#

the request ID for the invoice finalization

#

in_1OejRrDyFtOu3ZuTdw5RCcNn

#

the payment intent Id: pi_3OejRsDyFtOu3ZuT1MVewC8C

#

oh you need the req_...

#

req_oqY4SHlgePNBAH

dull seal
#

This works, taking a look here

primal birch
#

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

dull seal
#

I was just going to say that the invoice looks to be paid now.

primal birch
#

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

dull seal
#

Can you add more details to 'I was under the assumption that if I manual finalize it would also manual charge the payment intent?'

primal birch
#

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

dull seal
primal birch
#

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.

drowsy dockBOT
primal birch
#

So I have the payment_method_id the customer wants to use

orchid drift
#

๐Ÿ‘‹ stepping in as pgskc needs to step away

#

Catching up

primal birch
#

okay!

orchid drift
primal birch
#

ahh I see

#

so I would invoke in code - finalize, and then sequentially invoke pay

#

Like this

orchid drift
#

You don't even need the finalize call

#

The Pay API both finalizes and attempts payment

primal birch
#

oh forreal? that's awesome!

#

thank you guys!

orchid drift
#

Sure thing

primal birch
#

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

orchid drift
#

Going to need more information

#

Did you see an error?

#

Is there a PaymentMethod set to charge?

primal birch
#

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

orchid drift
#

Can I see that specific Invoice?

#

The Invoice ID, I mean

primal birch
#

in_1OejnRDyFtOu3ZuTRd7i0eeU

#

please note I was experimenting and I turned off automatic collection for this invoice

orchid drift
#

I don't see any attempted /pay request related to that Invoice

#

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

primal birch
#

Ahh I see. It is most likely that I did not update/save the code

orchid drift
#

๐Ÿ‘

primal birch
#

Thank you so much for your time

#

and patience