#Hemant - Subscription + Checkout

1 messages ยท Page 1 of 1 (latest)

wispy dawn
#

Hi ๐Ÿ‘‹

#

Which language/ SDK are you using?

floral umbra
#

I am using Java (Spring)

wispy dawn
#

Okay and do you have an event ID for one of those checkout.session.completed events?

floral umbra
#

Should be there, let me find that out and share

#

Unfortunately event id didnt get printed but i have the subscription id that came back in the payload. It is "sub_1KRP0ZAEkdu20a8XTPRTQKGC"

wispy dawn
#

You can always find event IDs in your dashboard but I'll see what I can find here

#

And your problem is that you cannot retrieve the Subscription after the checkout session is completed?

#

Do you have any checkout session IDs? Going from the subscription is kind of backwards

floral umbra
#

let me try to find checkout session id

#

and event id as well

#

Event Id : evt_1KRPNRAEkdu20a8X6ZVyOKnQ

wispy dawn
#

Okay so in this case you are receiving the subscription ID parameter as part of the object payload. Is there a reason you are not just using that ID to retrieve the Subscription object?

floral umbra
#

I thought i could avoid another unnecessary call to get Subscription from an id. As it was providing SubscriptionObject as well

wispy dawn
#

Well, without an additional API call, the Subscription object is stale. It no longer represents the truth of your system. Unless you're worried about rate limits I find it hard to understand why this would be an impediment.

floral umbra
#

I will use it, i was a little worried about the performance of the system. Since this is an asynchronous operation, i am good with it. I will retrieve it by subscription id. Thanks for your help.

wispy dawn
#

I can understand the performance concerns but I also know I've created tons of problems for myself trying to pre-optimize my code before I get everything running. ๐Ÿ™‚

floral umbra
#

Very true. Another concern , it says No such subscription: "sub_1KRPS8AEkdu20a8X4YMqI0lf"

this is the subscription id i got from the session only

wispy dawn
floral umbra
#

This is not for that event but the latest one i created and received this subscription id in the webhooks only.

wispy dawn
#

Do you have the webhook event ID for that one?

#

I need to step away but my esteemed colleague @urban fern will certainly be able to help clarify your situaiton

floral umbra
#

sure

#

evt_3KRPj5AEkdu20a8X1Mk6NRWW

#

No such subscription: 'sub_1KRPS8AEkdu20a8X4YMqI0lf'

urban fern
#

I'm confused, the event you shared is a PaymentIntent event payment_intent.succeeded

#

also that subscription id does not exist, where did you get it from?