#Hemant-checkout-subs

1 messages · Page 1 of 1 (latest)

elder gulch
#

Do you have the Event ID (evt_xxx) for the checkout.session.completed event where you're not getting back a subscription?

slate oasis
#

But when i try to retrieve it says no subscription

slate oasis
#

event id : evt_1KRiGNAEkdu20a8XF9sKANht

#

No such subscription: 'sub_1KRPS8AEkdu20a8X4YMqI0lf'

elder gulch
#

What event did you get sub_1KRPS8AEkdu20a8X4YMqI0lf from? Event evt_1KRiGNAEkdu20a8XF9sKANht is showing an entirely different subcription ID

slate oasis
#

my bad, yes the subscription id is different

#

Thanks @elder gulch let me correct it and come back to u , if i still get into some problem

#

Hi @elder gulch i updates the end date of subscription on event "checkout.session.completed". This is the code :

Subscription subscription = Subscription.retrieve(session.getSubscription());
subscription.setEndedAt(timeInMillis);

am i supposed to commit subscription back ? if yes, how can I do that ?

elder gulch
slate oasis
#

Sure