Hey guys,
I'm trying to implement iap to my game. I'm getting this "There is no item in the catalog with an ID matching the product ID in the receipt" error.
My Setup
this catalog selected as a primary
XCode log.
2019-06-23 14:43:42.440263+0300 raidfield2[1843:307005] UnityIAP: Finishing transaction 1000000539710973
UnityIAP: Promo interface is available for 6 items
UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
UnityEngine.Purchasing.JSONStore:OnPurchaseSucceeded(String, String, String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Export/Debug.bindings.h Line: 43)
Validation failed: /Client/ValidateIOSReceipt: There is no item in the catalog with an ID matching the product ID in the receipt
PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer)
PlayFab.Internal.<Post>c__Iterator1:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
(Filename: /Users/builduser/buildslave/unity/build/Runtime/Export/Debug.bindings.h Line: 43)
I checked other users' same questions but i cannot fix this issue.
What should i do?
Can you provide related codes? make sure you hide sensitive information.
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e) { if (!IsInitialized) { return PurchaseProcessingResult.Complete; } // Test edge case where product is unknown if (e.purchasedProduct == null) { return PurchaseProcessingResult.Complete; } // Test edge case where purchase has no receipt if (string.IsNullOrEmpty(e.purchasedProduct.receipt)) { return PurchaseProcessingResult.Complete; } var wrapper = (Dictionary<string, object>)MiniJson.JsonDecode(e.purchasedProduct.receipt); PlayFabClientAPI.ValidateIOSReceipt(new ValidateIOSReceiptRequest() { CurrencyCode = e.purchasedProduct.metadata.isoCurrencyCode, PurchasePrice = (int)e.purchasedProduct.metadata.localizedPrice * 100, ReceiptData = wrapper["Payload"].ToString() }, result => CompletePurchase(e.purchasedProduct), error => FailedPurchase(error) ); return PurchaseProcessingResult.Complete; }
void FailedPurchase(PlayFabError failNote){ Debug.Log("Validation failed: " + failNote.GenerateErrorReport()); } void CompletePurchase(Product product){ if(product.definition.id=="rf.pack.gold100"){ AddGold(100); }else if(product.definition.id == "rf.pack.gold500"){ AddGold(500); } else if (product.definition.id == "rf.pack.gold1000") { AddGold(1000); } else if (product.definition.id == "rf.pack.gold3000") { AddGold(3000); } else if (product.definition.id == "rf.pack.gold10000") { AddGold(10000); } } void BuyProductID(string productId) { if (!IsInitialized) throw new Exception("IAP Service is not initialized!"); // Pass in the product id to initiate purchase m_StoreController.InitiatePurchase(productId); } public void act_Buy(int index){ BuyProductID(Catalog[index].ItemId); }
Answer by MertCorekci · Jun 25, 2019 at 03:06 AM
Update
* Title ID= BEC1
* I can validate purchases on android
* All products' status are approved on itunes connect.
* I still getting this error: Validation failed: /Client/ValidateIOSReceipt: There is no item in the catalog with an ID matching the product ID in the receipt
It can be caused by including multiple items in his receipt. One of the items matches his catalog and the other does not. While PlayFab will still throw an error and fail to grant any items, when it happens.
The fix now is to ensure the receipt only contains ios product ids that match PlayFab catalog item ids.
I have exactly same problem, I validated my receipt via https://sandbox.itunes.apple.com/verifyReceipt and it contains multiple items, some of them event don't exist anymore because of changes in products. Do you have any ideas how to "clean" it to start testing from scratch?
Answer by litebox · May 06, 2020 at 09:25 AM
@SethDu, I have exactly same problem, I validated my receipt via https://sandbox.itunes.apple.com/verifyReceipt and it contains multiple items, some of them event don't exist anymore because of changes in products. Do you have any ideas how to "clean" it to start testing from scratch?