#jhonsalazar1623_docs

1 messages ¡ Page 1 of 1 (latest)

tawny mountainBOT
#

👋 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/1237920803329146983

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

gritty marlin
#

Hi there, are you asking what webhook event you should listen to get notified when an inovice is paid?

turbid kernel
#

Hi

#

Yes, but when my customer makes the payment and confirms the payment, the invoice does not change status immediately.

#

I am using stripe element and confirm payment

gritty marlin
#

Wha'ts the invoice ID?

turbid kernel
#

wait second please

#

my first stage
My customer paid with a payment method and is automatically charged without client secret

InvoiceCreateParams.builder()
.setCustomer(customerId)
.setCollectionMethod(InvoiceCreateParams.CollectionMethod.CHARGE_AUTOMATICALLY)
.setAutomaticTax(InvoiceCreateParams.AutomaticTax.builder().setEnabled(true).build())
.putMetadata("customerId", String.valueOf(customerExternalId))
.putMetadata("sellerId", sellerId.toString())
.putMetadata("subscriptionId", String.valueOf(subscriptionId))
.setDefaultPaymentMethod(paymentMethodId)
.build();

#

but the invoice is in open status
and I would like to generate the same events that the subscription generates so that my integration is compatible

#

because when the invoice paid event arrives my business logic is executed

gritty marlin
#

Can you share with me the invoice ID (i.e., in_xxx) so that I can the logs?

turbid kernel
#

yeah

#

POST /v1/invoices/in_1PEKswGCjaP6mkX5zWd5q25B/finalize

gritty marlin
#

I don't see any payment intent confirmation requests for the associated paymentIntent pi_3PEKsxGCjaP6mkX50afAU6C1

#

Did you see any error in your browser console when you call stripe.confirmPayment() ?

turbid kernel
#

no, this case is wihout payment intent

#

Then I will explain the other case with payment intent

gritty marlin
#

What do you mean by "wihout payment intent" ?

turbid kernel
#

InvoiceCreateParams.builder()
.setCustomer(customerId)
.setCollectionMethod(InvoiceCreateParams.CollectionMethod.CHARGE_AUTOMATICALLY)
.setAutomaticTax(InvoiceCreateParams.AutomaticTax.builder().setEnabled(true).build())
.putMetadata("customerId", String.valueOf(customerExternalId))
.putMetadata("sellerId", sellerId.toString())
.putMetadata("subscriptionId", String.valueOf(subscriptionId))
.setDefaultPaymentMethod(paymentMethodId)
.build();

#

This is my code for the first automatic payment scenario without payment intent

gritty marlin
#

And how do you let your customer pay this invoice? through payment element or hosted invoiec page?

turbid kernel
#

stripe element - payment element - yeah

#

If my client already has the payment method, there is no need to confirm the payment through the stripe element, the payment is made automatically.

#

you understand me?

gritty marlin
#

I don't quite understand unfortunately.

#

Are you asying that you want to pay the invoice with a saved payment method ?

turbid kernel
#

uhmmm

#

That is, if we already have a payment method, we pay directly with the payment method, is that understood?

turbid kernel
#

I think we'll start again

#

How can I make an invoice that is automatically charged to my customer's payment method?