I’m already familiar with the ability to get the Stripe Subscription detail (Subscription_id, Status, etc) on behalf of a specified user.
What I’m having trouble with is how to get the subscription detail for a user when the subscription is being paid for by a different user.
My application has Team Leads and Team Members. Team Leads buy subscriptions on behalf of Team Members.
For the examples below, the specific detail I’m looking for is Subscription_id.
User A buys subscriptions for users B, C, and D.
Now User C is logged in and I want to query their Subscription_id.
Current User’s Stripe Customer subscription’s Subscription_id returns a value, but it’s returning the same value no matter which team member account I log in with.
What I need is to get not only a unique value based on which user I’m logged in as, but the same value that corresponds with the Subscription_id that was returned when the subscription was initially purchased.
Ideally I will supply the subscription ID and I’ll get back the subscription status.
Does anyone know how to do this?
Subsequent edit…
It seems the detail being returned is relevant to the most recent subscription purchased by the Team Lead, which when I think about it, kind of makes sense.
Tag user B C and D with User A. Whenever User A buys a subscription for any other user, add the user to list of users in User A’s table.
When user C tries to login, the condition should check whether user C has a active subscription from user A’s table and return yes or no.
If yes, allow the user to login or return to any other page or throw a warning message.
“When user C tries to login, the condition should check whether user C has a active subscription from user A’s table and return yes or no.”.
It’s not clear to me HOW I do this step, as it seems to me that when user C logs in, I can check for the status of the most recent subscription purchased directly by user C, and user C never directly purchased any subscriptions.
I was however able to solve this in a different way. Using the API Connector, I was able to create an API call to stripe which would return the subscription detail for a specified Subscription_id.
As since every time user A purchased a subscription on behalf of user B, C, or D, the Subscription_id is stored in a field in the User record for user B, C, or D so I’m able to use this API Connector API call to get subscription details for Current User by referencing the Subscription_id value in their User record.