> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 欺诈防范、兑换、收据验证

> 了解欺诈防范、物品兑换、收据验证和其他防盗版措施。

<Info>
  Economy v2 现已正式发布。如需支持和反馈，请访问 [PlayFab 论坛](https://community.playfab.com)。
</Info>

任何游戏经济系统的核心都是允许玩家使用虚拟货币或真实世界 (RW) 货币购买游戏物品、货币等。

## 欺诈途径

### 欺骗、代理和请求重复

用于伪装玩家从不同于其实际位置进行购买的请求手法。玩家伪造 IP 地址、使用代理或重复请求是常见场景。

你可以使用[幂等事务](#idempotent-transactions)来对抗这些欺诈途径。

### 未验证的 Store API 调用

未验证的 Store API 调用是指没有有效收据就对 Store API 进行的调用。这些调用可以通过伪造收据或重复请求来完成。

[收据验证](#receipt-validation)是一项可用于对抗这种欺诈途径的功能。

### 兑换后退款

玩家可以进行购买、兑换购买，然后向商店请求退款。

你可以使用 PlayFab 的[退款流程](#refunds)检查退款。

### 盗版、破解和身份验证绕过

盗版是未经版权持有者许可复制和分发软件的行为。破解是修改软件以移除或绕过其复制保护的行为。身份验证绕过是用于规避帐户注册和登录的手法。

你可以通过[反盗版技术](#anti-piracy)将盗版玩家转化为付费客户。

## 幂等事务

PlayFab Economy v2 事务具有幂等性，这意味着它们可以重试任意次数，如果事务已经完成，则该事务将被忽略。当玩家尝试进行购买并且请求被重复时，玩家不会被重复扣款。

需要注意的是，虽然大多数事务需要 IdempotencyId 来确保幂等性，但兑换 API 的工作方式略有不同。兑换 API 也具有幂等性，但不需要 IdempotencyId。它们只会授予市场报价一次。如果你使用之前成功请求的相同市场收据发出兑换请求，PlayFab 在第二次调用时不会授予任何内容。

在我们的[库存概述](/services/playfab/economy-monetization/economy-v2/inventory#idempotency)中详细了解幂等性。

## 收据验证

Economy v2 支持以下附加 API 端点：

* Microsoft Store（[Windows 10/11](https://learn.microsoft.com/en-us/windows/uwp/publish/)、[XBOX](https://learn.microsoft.com/en-us/gaming/xbox/)、[Android](https://blogs.windows.com/windows-insider/2021/10/20/announcing-android-apps-on-windows-11-preview-for-windows-insiders-in-the-beta-channel/)）
  * [GetMicrosoftStoreAccessTokens](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/get-microsoft-store-access-tokens)
  * [RedeemMicrosoftStoreInventoryItems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-microsoft-store-inventory-items)
* Google Play Store (Android)
  * [RedeemGooglePlayInventoryItems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-google-play-inventory-items)
* Apple AppStore (iOS)
  * [RedeemAppleAppStoreInventoryItems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-apple-app-store-inventory-items)
* Nintendo Switch E-Shop (Switch)
  * [RedeemNintendoEShopInventoryItems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-nintendo-e-shop-inventory-items)
* Sony PlayStation Store Next-gen (PS4/PS5)
  * [RedeemPlayStationStoreInventoryitems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-play-station-store-inventory-items)
* Steam (Windows 10/11, OSX, Linux)
  * [RedeemSteamInventoryItems](https://learn.microsoft.com/en-us/rest/api/playfab/economy/inventory/redeem-steam-inventory-items)

## 退款

* 检查退款
  * 要根据退款查找玩家，请对 `items_redeemed` 事件进行搜索并找到收据 ID。

<Tip>
  在本地保留超过 Insights 保留期限的旧事件副本。
</Tip>

你可以使用 [Insights](/services/playfab/data-analytics/learn-data/data-explorer) 检测和防止这种欺诈途径。

## 反盗版

对抗盗版并将盗版者转化为付费客户的技术：

* 为所有物品和版本设置正确的区域定价：
  定价过高的物品或订阅是盗版的常见原因。[查看 Microsoft Store 支持的市场](https://learn.microsoft.com/en-us/windows/uwp/publish/define-market-selection)。
* 尽可能支持每个市场支持的所有平台：
  不为热门平台提供移植版本可能会导致用户创建非官方移植版本。为非官方游戏客户端提供添加官方付费许可的方式可以增加收入并限制盗版。
* 使用 PlayFab 匿名登录方法，并可选择注册以获得更多功能：
  PlayFab [支持不使用 PlayFab 帐户进行身份验证](/services/playfab/identity/player-identity/login/login-basics-best-practices#anonymous-login-mechanisms)，然后再进行链接注册。许多玩家会拒绝注册帐户，但愿意匿名游玩。匿名登录是让玩家试玩游戏并稍后将其转化为付费客户的好方法。
* 激励在线帐户注册和链接：
  与在线帐户配合最佳的功能（如云端存档、排行榜和跨平台游戏）可用于激励玩家注册帐户。
* 为盗版者提供购买途径：
  即使玩家使用非官方游戏客户端，也向他们提供官方商店页面的链接，以便他们购买游戏许可。有些玩家并不知道他们使用的是盗版副本。
* 使用 PlayFab 玩家分段来分隔"低信任"玩家池：
  PlayFab [支持玩家分段](/services/playfab/live-service-management/game-configuration/segmentation/segmentation-configuration)，可用于将玩家分成"高信任"和"低信任"池。信任分段用于限制访问那些更可能被盗版者滥用的功能。这些功能的一些示例包括跨平台游戏、云端存档和排行榜。


## Related topics

- [欺诈防范、兑换、收据验证](/zh-CN/services/playfab/economy-monetization/economy-v2/fraud-prevention/index.md)
- [PlayFab UGC 文档](/zh-CN/services/playfab/economy-monetization/economy-v2/ugc/index.md)
- [欺诈防范快速入门](/zh-CN/services/playfab/economy-monetization/economy-v2/fraud-prevention/quickstart.md)
- [PlayFab 概念](/zh-CN/services/playfab/get-started/concepts.md)
- [使用 Steam 市场进行兑换](/zh-CN/services/playfab/economy-monetization/economy-v2/marketplace/marketplace-redemption/steam.md)
