How would I be able to get the user’s subscription purchase time?
From a quick search, it seems that the most applicable function for you to use is the GetUserSubscriptionPaymentHistoryAsync method of MarketplaceService.
Note that if the user has been subscribed for longer than 1 year, then it will always just say 1 year.
(That’s assuming you meant the in game subscription thing, and not Roblox Premium)
It keeps returning an empty table (aka {})
print(marketplace:GetUserSubscriptionPaymentHistoryAsync(plr,ID))
If you temporarily replace it with GetUserSubscriptionStatusAsync, what does it give?
Once I purchase it in studio it prints
▼ {
[“IsRenewing”] = false,
[“IsSubscribed”] = true
}
How long ago did you subscribe to it?
It prints each 2 seconds in a while do loop right now (For testing), and I subscribed like a second or 2 ago.
The subscription would be processing still, hence it won’t show up when using the initial method I suggested.
Apparently there are some test IDs that you can use to test your functions in the mean time:
Try using EXP-0.
It prints it out with the end, start, and payment type stuff… But I want to get the start time without having to wait for it to be completed, because what I need to do is to store the start time into a database so I can give the player all the remaining benefits if they dont log on for the remainder of the subscription.
If the payment is processing, you could try just saving the current date to the datastore. I can’t advise it entirely though, because if the payment doesn’t get processed then they could be getting items without paying for them.
The reason why im trying to get the start time is because some users might purchase the subscription via the website, so when they join the game, I need to get the purchase time. (For the benefits)
Then you will need to wait until the subscription is processed. There’s not a work around for it.
Wait, just to ask… when you talk about “processed”, do you mean about when the subscription ends? Or when it finishes completing the purchase?
Processed, when Roblox confirms that the payment has been received.
Alright. How long does that take?
¯\_(ツ)_/¯
(It’s not explicitly stated how long it takes, but it should take like a day max)
Thank you for all the information.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.