question

topstitch avatar image
topstitch asked

Steam IAP, Unity: PurchaseInitializationFailure / Failed to initiate transaction with payment provider

Hi, I'm trying to set up in-app purchases via Steam and running into trouble. I'm using this guide as a reference: https://docs.microsoft.com/en-us/gaming/playfab/features/commerce/economy/non-receipt-payment-processing#last-step-confirm-the-purchase

I've configured my Steam Application ID and Steam Web API Key on the Add-Ons page. I triple checked to make sure that these values are correct. "Use Steam Payments sandbox endpoints for test transactions" is currently set to True, although I have also tried it setting it to False with no change.


I'm using the Facepunch library in Unity to handle Steamworks calls.

When the game starts, I call Steamworks.SteamClient.Init ("appid"); with my game's app ID. At this point I can see that I am playing my game in the Steam friends list via rich presence.

I can then successfully initiate the purchase via a PlayFabClientAPI.StartPurchase call.

Unfortunately, when I follow up with a PlayFabClientAPI.PayForPurchase call, I always receive " PurchaseInitializationFailure / Failed to initiate transaction with payment provider ". My PayForPurchase call is structured like this:

PlayFab.ClientModels.PayForPurchaseRequest request = new PlayFab.ClientModels.PayForPurchaseRequest () {
OrderId = orderID,
ProviderName = "Steam",
Currency = "RM"
};


I thought that perhaps this was failing while testing in the Unity editor because the Steam overlay cannot open in this context. I also tried compiling a game build, manually adding it to steam, and testing there; although I am able to open the Steam overlay normally in this context, I receive the same PurchaseInitializationFailure. I even tried distributing a proper game build via Steampipe and testing via a full Steam launch... same error, no dice.

What am I missing here? Is it mandatory for me to also link a steamID to a user's playfab account in order for these calls to work, for example?

I've thoroughly exhaused all of the threads on this topic that I could find at this point. Would really appreciate some help.

Thanks!

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Have you checked the "Enable sandbox mode for purchasing in Steam" option that in the [Game Manager]->[Title Settings]->[General]?

0 Likes 0 ·
topstitch avatar image topstitch Seth Du ♦ commented ·

Yes, I mentioned that in my post, I have tried both enabling and disabling it with no result.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ topstitch commented ·

Your question indicates the option in Add-on Page, which is different from the option in title settings. Because we are not allowed to check add-on page due to the policy, will you double check the place I have mentioned above?

0 Likes 0 ·
Show more comments

1 Answer

·
Seth Du avatar image
Seth Du answered

>>Is it mandatory for me to also link a steamID to a user's playfab account in order for these calls to work?

Yes, it is necessary, and you may need to use LoginWithSteam for login, which also means the player now keeps a valid steam access ticket. Then you can call for purchase.

Please also check the discussion on Processing Payment Through Steam: PurchaseInitializationFailure - Playfab Community.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.