#sadeghiamir_webhooks

1 messages ¡ Page 1 of 1 (latest)

low groveBOT
#

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

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

ripe kraken
#

if (subscription != null) {
appTracker.sendServiceLog("process_stripe_3.1_invoice_id", SERVICE_NAME, user.getId(), null, false, subscription.getLatestInvoice(), BigQueryEventLevel.INFO);
Invoice invoice = null;
if (subscription.getLatestInvoice() != null) {
invoice = stripeGateway.getLastInvoiceOfSubscription(subscription.getLatestInvoice());
}
log.info("invoice {} for subscription {}", invoice, subscription);
if (invoice == null) log.error("subscription has not invoice id :{}", subscription);
appTracker.sendServiceLog("process_stripe_3.2_webhook_payment_intent_id", SERVICE_NAME, user.getId(), null, false, invoice != null ? invoice.getPaymentIntent() : null, BigQueryEventLevel.INFO);

                            PaymentIntent paymentIntent = null;
                            if (invoice != null && invoice.getPaymentIntent() != null)
                                paymentIntent = stripeGateway.getPaymentIntent(invoice.getPaymentIntent());
                            if (paymentIntent == null) log.error("payment intent does not exist :{}", invoice);
                            appTracker.sendServiceLog("process_stripe_3.3_webhook_payment_intent", SERVICE_NAME, user.getId(), null, false, paymentIntent != null ? paymentIntent.toJson() : null, BigQueryEventLevel.INFO);
                            if (paymentIntent != null && Objects.equals(paymentIntent.getStatus(), "succeeded"))
                                updateSubscriptionFromStripeSubscriptionWebhook(subscription, user);
                        }
cloud harbor
#

Hi there, in_1QHIBADNZsE8LVSagONcSHYs is not finalized and that's why its paymentIntent is null

ripe kraken
#

after finalize payentIntent , I get customer.subscription.updated again?

cloud harbor
#

You mean when the invoice is finalized? you will receive a invoice.finalized event

ripe kraken
#

I listen to customer.subscription.updated only and update end of subscription in my application with this webhook event.
if I Ignore getting invoice and payment Intent , the current period end of subscription is not valid for using in my application.
but if I got this event again after payent ment succeeded , I can trust to this webhook

cloud harbor
#

if the primary objective is to get notified if the invoice payment succeeds. Then you should listen to invoice.paid event

ripe kraken
#

other question:
When a payment fails, Stripe automatically retries a few times. If payment does not succeed after multiple tries, do we get a customer.subscription.deleted webhook?

cloud harbor
ripe kraken
#

how can get only active subscriptions related to customer from stripe api in spring boot?