marketPlaceServiceUtil
An utility module for working with MarketplaceService.
Functions
productInfoPromise
marketPlaceServiceUtil.
productInfoPromise
(
assetId:
number
,
infoType:
Enum.InfoType?
) →
Promise
<
ProductInfo
>
Returns a promise which is resolved wih the product info of the given place id.
userOwnsGamepassPromise
marketPlaceServiceUtil.
userOwnsGamepassPromise
(
userId:
number
,
gamepassId:
number
) →
Promise
<
boolean
>
Returns a promise which is resolved with a boolean indicating if the user owns the specified gamepass or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.
local wasSucessfull, userOwnsGamepass, errorMessage = marketPlaceServiceUtil.userOwnsGamepassPromise(123, 45678123):await()
if wasSucessfull then
print(userOwnsGamepass)
else
print(userOwnsGamepass) --> false
print(errorMessage)
end
playerOwnsAssetPromise
Returns a promise which is resolved with a boolean indicating if the player owns the specified asset or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.
local wasSucessfull, playerOwnsAsset, errorMessage = marketPlaceServiceUtil.playerOwnsAssetPromise(123, 45678123):await()
if wasSucessfull then
print(playerOwnsAsset)
else
print(playerOwnsAsset) --> false
print(errorMessage)
end
playerOwnsBundlePromise
Returns a promise which is resolved with a boolean indicating if the player owns the specified bundle or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.
local wasSucessfull, playerOwnsBundle, errorMessage = marketPlaceServiceUtil.playerOwnsBundlePromise(123, 45678123):await()
if wasSucessfull then
print(playerOwnsBundle)
else
print(playerOwnsBundle) --> false
print(errorMessage)
end
subscriptionInfoProductPromise
marketPlaceServiceUtil.
subscriptionInfoProductPromise
(
subscriptionId:
string
) →
Promise
<
SubscriptionInfo
>
Returns a promise which is resolved with the info of the given subscription id.
local wasSucessfull, subscriptionInfo = marketPlaceServiceUtil.subscriptionInfoProductPromise(subscriptionId):await()
if wasSucessfull then
print(subscriptionInfo)
else
print(tostring(subscriptionInfo)) -- Error
end
userSubscriptionDetailsPromise
marketPlaceServiceUtil.
userSubscriptionDetailsPromise
(
subscriptionId:
string
) →
Promise
<
UserSubscriptionDetails
>
Returns a promise which is resolved with the user subscription details.
local wasSucessfull, userSubscriptionDetails = marketPlaceServiceUtil.userSubscriptionDetailsPromise(player, subscriptionId):await()
if wasSucessfull then
print(userSubscriptionDetails)
else
print(tostring(userSubscriptionDetails)) -- Error
end
userSubscriptionPaymentHistoryPromise
marketPlaceServiceUtil.
userSubscriptionPaymentHistoryPromise
(
subscriptionId:
string
) →
Promise
<
UserSubscriptionPaymentHistory
>
Returns a promise which is resolved with the user subscription payment history.
local wasSucessfull, userSubscriptionPaymentHistory = marketPlaceServiceUtil.userSubscriptionPaymentHistoryPromise(player, subscriptionId):await()
if wasSucessfull then
print(userSubscriptionPaymentHistory)
else
print(tostring(userSubscriptionPaymentHistory)) -- Error
end
userSubscriptionStatusPromise
marketPlaceServiceUtil.
userSubscriptionStatusPromise
(
subscriptionId:
string
) →
Promise
<
UserSubscriptionStatus
>
Returns a promise which is resolved with the user subscription payment history.
local wasSucessfull, userSubscriptionStatus = marketPlaceServiceUtil.userSubscriptionStatusPromise(player, subscriptionId):await()
if wasSucessfull then
print(userSubscriptionStatus)
else
print(tostring(userSubscriptionStatus)) -- Error
end
activeAssetProductInfoWhichPlayerOwnsPromise
marketPlaceServiceUtil.
activeAssetProductInfoWhichPlayerOwnsPromise
(
playerUserId:
number
,
assetId:
number
) →
(
)
Retrieves the asset product info that belongs to a player of userid playerUserId
.