通过Steam进行支付

注意
如果与Steam有直接合同关系,请按照本说明进行配置。即使已实现通过Steam进行用户身份认证,艾克索拉支付中心内的其他支付方式仍可正常使用,无需额外配置。

玩家通过Steam为游戏内购买项进付款时,艾克索拉可作为付款直接帐户。这样您就不必集成Steam SDK或在设置游戏内商店时考虑通过Steam支付的情况下需完成的繁琐设置。

要设置通过Steam进行支付:

  1. 与艾克索拉签署补充协议。
注:
通过Steam进行支付时,艾克索拉收取较少的收入分成。详细信息请咨询您的客户成功经理。
  1. 在发布商帐户中设置Steam直接帐户
  2. 设置通过Steam进行原生身份认证
  3. 使用SDK方法实现商品购买逻辑。
  1. 在您的应用程序中实现购买逻辑时,请调用SteamUtils.GetAdditionalCustomHeaders方法来获取额外请求头。调用SDK方法(如Purchase)进行购买或创建订单(如PurchaseItem)时,将收到的头传入customHeaders参数。
  2. 如需在Steam浮层中打开支付UI(可选),可在调用Purchase方法时传入包含UseSteamOverlayForDesktop = true参数的PlatformSpecificAppearance对象。

通过Steam进行商品购买的脚本示例:

Copy
Full screen
Small screen
 1using UnityEngine;
 2using Xsolla.Catalog;
 3using Xsolla.Core;
 4
 5namespace Xsolla.Samples.Steam
 6{
 7	public class SellViaSteamGateway : MonoBehaviour
 8	{
 9		// Function for starting the purchase process via Steam Gateway
10		public void PurchaseItem(string itemSku)
11		{
12			// Get additional headers for the request from `SteamUtils` class
13			var additionalHeaders = SteamUtils.GetAdditionalCustomHeaders();
14			// Create `PlatformSpecificAppearance` object and set up `UseSteamOverlayForDesktop`
15			var appearance = new PlatformSpecificAppearance {
16				UseSteamOverlayForDesktop = true
17			};
18			// Starting the purchase process
19			// Pass the `itemSku` parameter and callback functions for success and error cases
20			// Pass `additionalHeaders` variable as the optional `customHeaders` parameter
21			// Pass `appearance` variable as the optional `platformSpecificAppearance` parameter
22			XsollaCatalog.Purchase(itemSku, OnPurchaseSuccess, OnError, customHeaders: additionalHeaders, platformSpecificAppearance: appearance);
23		}
24		private void OnPurchaseSuccess(OrderStatus status)
25		{
26			Debug.Log("Purchase successful");
27			// Add actions taken in case of success
28		}
29		private void OnError(Error error)
30		{
31			Debug.LogError($"Error: {error.errorMessage}");
32			// Add actions taken in case of error
33		}
34	}
35}
本文对您的有帮助吗?
谢谢!
我们还有其他可改进之处吗? 留言
非常抱歉
请说明为何本文没有帮助到您。 留言
感谢您的反馈!
我们会查看您的留言并运用它改进用户体验。

有用链接

上次更新时间: 2026年5月19日

发现了错别字或其他内容错误? 请选择文本,然后按Ctrl+Enter。

报告问题
我们非常重视内容质量。您的反馈将帮助我们做得更好。
请留下邮箱以便我们后续跟进
感谢您的反馈!
无法发送您的反馈
请稍后重试或发送邮件至doc_feedback@xsolla.com与我们联系。