needle-mirror / com.unity.purchasing

[Mirrored from UPM, not affiliated with Unity Technologies.] 📦 IMPORTANT UPGRADE NOTES:If updating from Unity IAP (com.unity.purchasing + the Asset Store plugin) versions 2.x to version 3.x, complete the following actions in order to resolve compilation errors: 1. Move IAPProductCatalog.json and BillingMode.jsonFROM: Assets/Plugins/UnityPurchasing/Resources/TO: Assets/Resources/. 2. Move AppleTangle.cs and GooglePlayTangle.csFROM: Assets/Plugins/UnityPurchasing/generatedTO: Assets/Scripts/UnityPurchasing/generated. 3. Remove all remaining Asset Store plugin folders and files in Assets/Plugins/UnityPurchasing from your project.PACKAGE DESCRIPTION:With Unity IAP, setting up in-app purchases for your game across multiple app stores has never been easier.This package provides: ▪ One common API to access all stores for free so you can fully understand and optimize your in-game economy ▪ Automatic coupling with Unity Analytics to enable monitoring and decision-making based on trends in your revenue and purchase data across multiple platforms ▪ Support for iOS, Mac, tvOS, Google Play, Windows, and Amazon app stores(*). ▪ Support to work with the Unity Distribution Portal to synchronize catalogs and transactions with other app stores ▪ Client-side receipt validation for Apple App Store and Google PlayAfter installing this package, open the Services Window to enable In-App Purchasing to use these features.
https://docs.unity3d.com/Packages/com.unity.purchasing@4.9/manual/index.html
Other
30 stars 8 forks source link

OnPurchaseFailed - ProductUnavailable, wrong PurchaseFailureDescription productId #4

Closed manudiaz-omnidrone closed 5 months ago

manudiaz-omnidrone commented 5 months ago

Hi there 👋

We were debugging/researching some failing purchases and found something that we believe is wrong:

On PurchasingManager.InitiatePurchase(Product? product, string developerPayload), if the product is not available the PurchaseFailureDescription is built with the product.TransactionId instead of product.defintion.id which is the real ProductId ⚠️ 👀

https://github.com/needle-mirror/com.unity.purchasing/blob/25227d5d94b34311539a42a214227e6cc2a0027d/Runtime/Purchasing/PurchasingManager.cs#L64-L69

On all the other calls to the PurchaseFailureDescription ctor, the id given is the ProductId (Sku), except for the call below.

Is this intended or is an error??

Thanks!