#.suryamani

1 messages · Page 1 of 1 (latest)

open scrollBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

spare anchor
#

How will i find difference between subscription and upgrading/downgrading?

dense dragon
#

Could you elaborate a bit more? Which 2 events or objects are you looking at exactly?

spare anchor
#

I'm using events to send emails based on it, If payment was failed that time also customer.subcription.updated generates and send emails so i need to check its upgading or downgrading to allow customer.subscription.updated event

dense dragon
#

So you want to know it is upgrading or downgrading, correct?

spare anchor
#

yes

dense dragon
#

If you look at previous_attributes you can see the previous Price Id. Compare it with the current Price Id, you will know whether it's upgrading or downgrading

spare anchor
#

previous attribute is null for me

#

How will i get price id from previous attribute?

dense dragon
#

Null meaning it's not a Price updating

spare anchor
#

then i only check that is null or not, If its null its not upgrading or downgrading I'm i right?

dense dragon
#

Yes

spare anchor
#

ok

#

var previousPrice = (Stripe.Subscription)stripeEvent.Data.PreviousAttributes;
var previousPriceId = previousPrice.Items.Data[0].Price.Id;

#

this is corect to get price id

dense dragon
#

If it's not null. Please test the code out with your Test mode key

spare anchor
#

How should i see session id in stripe

dense dragon
#

Could you elaborate? Which Session are you referring to?

spare anchor
#

var subscriptionData = new SubscriptionData();
var subscriptionService = new SubscriptionService();
var subscriptionDetails = new SubscriptionDetails();
var service = new SessionService();
var getdata = service.Get(subscriptionData.SessionID);
var subscription = subscriptionService.Get(getdata.SubscriptionId);

#

here i get sessionid

#

How should i see that sessionId in stripe?

dense dragon
#

Can you paste here the format or one example value of that sessionId?

spare anchor
#

cs_test_a1tSkKtp4snb9C3ZgtNGJmlo1wm3OkeVUy1zQmLFUfnnx5AXKHIh8s85jM