#Estela

1 messages · Page 1 of 1 (latest)

meager anchorBOT
graceful moss
#

Hi there

#

Yep you can create Invoices on a Connected Account.

nocturne saffron
#

I'm checking, I tell you now

#

With this header, can I generate two same invoices for one payment or just one?

graceful moss
#

Do you mean actually generating an Invoice from the Checkout Session?

#

Or creating Invoices separately

nocturne saffron
#

from the Checkout Session

graceful moss
#

Okay then yeah only one Invoice related to the Checkout Session

#

You can create another Invoice separately and just "mark it as paid"

nocturne saffron
#

When I create the checkout session I save the Payment Intent id, could I generate multiple invoices with it or refer to it in some way when creating a new invoice?

graceful moss
#

No not really

#

The only way you can refer to it is via metadata on the Invoice

graceful moss
#

That will create an Invoice related to the Checkout Session and the PaymentIntent for that Checkout Session

#

But you can't refer back to that same PaymentIntent for a second Invoice

nocturne saffron
#

Understood

#

I think that with that link I answer my other question. Is there a way to edit the invoice that is generated? Such as adding a text in the body of the document.

graceful moss
#

No you can't edit a finalized Invoice

nocturne saffron
#

before finalizing, in the checkout session

#

Map<String, Object> inv = new HashMap<>();
inv.put("enabled", true);
// CREATE ORDER
String transferGroupId = TRANSFRER_GROUP + order.getId();
SessionCreateParams params = SessionCreateParams
.builder()
.setMode(SessionCreateParams.Mode.PAYMENT)
.addAllLineItem(lineItemsList)
.setAutomaticTax(
SessionCreateParams.AutomaticTax.builder()
.setEnabled(true)
.build())
.setSuccessUrl(DOMAIN + URL_PAYMENT_CONFIRM + "?session_id={CHECKOUT_SESSION_ID}")
.setCancelUrl(DOMAIN + URL_PAYMENT_CONFIRM)
.setPaymentIntentData(
SessionCreateParams.PaymentIntentData.builder().setTransferGroup(transferGroupId).build())
.putExtraParam("invoice_creation", inv)
.build();

graceful moss
#

No an Invoice is only generated via Checkout after the Session is completed

#

If you look at the link you provided above you will see it says:

Generate a post-purchase Invoice for one-time payments.

nocturne saffron
graceful moss
#

Sounds good. Let me know if I can help any further

nocturne saffron
#

Thank you very much for your help!!

#

Have a nice day! 🙂