# MarketplaceService(ロブロックス クラス) > ゲームパスや開発者製品など、ゲーム内での購入を扱うサービスです。 - URL:https://roblox.minecraft-okinawa.com/reference/classes/MarketplaceService/ - 公式:https://create.roblox.com/docs/reference/engine/classes/MarketplaceService - 受け継いでいるクラス:Instance ## メソッド - `MarketplaceService:BindReceiptHandler(transactionType: ReceiptType, handler: Function, filter: Array?): RBXScriptConnection`:Registers a callback to process receipts of a specific type. - `MarketplaceService:GetDeveloperProductsAsync(): Instance`:Returns a Pages object which contains information for all of the current experience's developer products. - `MarketplaceService:GetProductInfoAsync(assetId: int64, infoType: InfoType): Dictionary`:Returns the product information of an asset using its asset ID. - `MarketplaceService:GetRobloxSubscriptionDetailsAsync(user: Player): Dictionary`:Returns the subscription details for the given user for the Roblox Subscription ecosystem. - `MarketplaceService:GetSubscriptionProductInfoAsync(subscriptionId: string): Dictionary`:Returns the product information of a subscription for the given subscriptionId. - `MarketplaceService:GetUsersPriceLevelsAsync(userIds: Array): List`:Returns the regionalized price levels of users, representing the recommended price for an item in each user's regional market. - `MarketplaceService:GetUserSubscriptionDetailsAsync(user: Player, subscriptionId: string): Dictionary`:Returns a table that contains the details of the user's subscription for a given subscriptionId. - `MarketplaceService:GetUserSubscriptionPaymentHistoryAsync(user: Player, subscriptionId: string): Array`:Returns an Library.table|Array that contains up to one year of the user's subscription payment history for the given subscriptionId. - `MarketplaceService:GetUserSubscriptionStatusAsync(user: Player, subscriptionId: string): Dictionary`:Returns a table that contains the subscription status of the user for the given subscriptionId. - `MarketplaceService:OpenShop(player: Player): ()`:Opens a personalized in-game Shop for the given player. - `MarketplaceService:PlayerOwnsAssetAsync(player: Instance, assetId: int64): boolean`:Returns whether the given user has the given asset. - `MarketplaceService:PlayerOwnsBundleAsync(player: Player, bundleId: int64): boolean`:Returns whether the given player owns the given bundle. - `MarketplaceService:PromptBulkPurchase(player: Player, lineItems: Array, options: Dictionary): ()`:Prompts a user to purchase multiple avatar items with the given assetId or bundleId. - `MarketplaceService:PromptBundlePurchase(player: Instance, bundleId: int64): ()`:Prompts a user to purchase a bundle with the given bundleId. - `MarketplaceService:PromptCancelSubscription(user: Player, subscriptionId: string): ()`:Prompts a user to cancel a subscription for the given subscriptionId. - `MarketplaceService:PromptGamePassPurchase(player: Instance, gamePassId: int64): ()`:Prompts a user to purchase a pass with the given gamePassId. - `MarketplaceService:PromptProductPurchase(player: Instance, productId: int64, equipIfPurchased: boolean, currencyType: CurrencyType): ()`:Prompts a user to purchase a developer product with the given productId. - `MarketplaceService:PromptPurchase(player: Instance, assetId: int64, equipIfPurchased: boolean, currencyType: CurrencyType): ()`:Prompts a user to purchase an item with the given assetId. Does not work for USD Creator Store purchases. - `MarketplaceService:PromptRobloxSubscriptionPurchase(user: Player): ()`:Prompts a user to purchase a Roblox Plus subscription. - `MarketplaceService:PromptRobuxTransferAsync(sender: Player, receiverUserId: int64, amount: int64): string`:Initiates a Robux transfer from the sender to another user. - `MarketplaceService:PromptSubscriptionPurchase(user: Player, subscriptionId: string): ()`:Prompts a user to purchase a subscription for the given subscriptionId. - `MarketplaceService:RankProductsAsync(productIdentifiers: Array): List`:Takes a list of product IDs and returns a personalized ordered list of those products. - `MarketplaceService:RecommendTopProductsAsync(infoTypes: Array): List`:- Takes an array of InfoType and returns up to 50 items representing the products a user is most likely to engage with and purchase. - `MarketplaceService:UserOwnsGamePassAsync(userId: User, gamePassId: int64): boolean`:Returns true if the player with the given Class.Player.UserId|UserId owns the pass with the given gamePassId. ## イベント - `MarketplaceService.PromptBulkPurchaseFinished(player: Instance, status: MarketplaceBulkPurchasePromptStatus, results: Dictionary)`:Fires when a purchase prompt for bulk avatar items is closed. - `MarketplaceService.PromptBundlePurchaseFinished(player: Instance, bundleId: int64, wasPurchased: boolean)`:Fires when a bundle purchase prompt closes. - `MarketplaceService.PromptGamePassPurchaseFinished(player: Instance, gamePassId: int64, wasPurchased: boolean)`:Fires when a purchase prompt for a pass is closed. - `MarketplaceService.PromptPremiumPurchaseFinished()`:Fires when a purchase prompt for Roblox Premium is closed. - `MarketplaceService.PromptProductPurchaseFinished(userId: int64, productId: int64, isPurchased: boolean)`:Fires when a purchase prompt for a developer product is closed. Do not use this event to process purchases. - `MarketplaceService.PromptPurchaseFinished(player: Instance, assetId: int64, isPurchased: boolean)`:Fires when a purchase prompt for an affiliate gear sale or other asset is closed. Does **not** fire for developer product or pass prompts. - `MarketplaceService.PromptRobloxSubscriptionPurchaseFinished(user: Player, didTryPurchasing: boolean)`:Fires when a purchase prompt for Roblox Plus is closed. - `MarketplaceService.PromptSubscriptionPurchaseFinished(user: Player, subscriptionId: string, didTryPurchasing: boolean)`:Fires when a purchase prompt for a subscription is closed. ## コールバック - `MarketplaceService:ProcessReceipt(receiptInfo: Dictionary): ProductPurchaseDecision`:A callback to process receipts of developer product purchases. 英語の説明とメンバー一覧:Roblox Creator Documentation(CC BY 4.0)。日本語の解説はこのサイト独自のものです。 執筆:鈴木孝昌(現役プロジェクトマネージャー/プログラミング講師)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)