#.suryamani
1 messages · Page 1 of 1 (latest)
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.
- .suryamani, 14 hours ago, 62 messages
- .suryamani, 1 day ago, 23 messages
- .suryamani, 1 day ago, 43 messages
- .suryamani, 5 days ago, 19 messages
- .suryamani, 5 days ago, 10 messages
How will i find difference between subscription and upgrading/downgrading?
Could you elaborate a bit more? Which 2 events or objects are you looking at exactly?
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
So you want to know it is upgrading or downgrading, correct?
yes
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
Null meaning it's not a Price updating
then i only check that is null or not, If its null its not upgrading or downgrading I'm i right?
Yes
ok
var previousPrice = (Stripe.Subscription)stripeEvent.Data.PreviousAttributes;
var previousPriceId = previousPrice.Items.Data[0].Price.Id;
this is corect to get price id
If it's not null. Please test the code out with your Test mode key
How should i see session id in stripe
Could you elaborate? Which Session are you referring to?
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?
Can you paste here the format or one example value of that sessionId?
cs_test_a1tSkKtp4snb9C3ZgtNGJmlo1wm3OkeVUy1zQmLFUfnnx5AXKHIh8s85jM