question

MertCorekci avatar image
MertCorekci asked

There is no item in the catalog with an ID matching the product ID in the receipt

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?

In-Game Economy
5 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 ·

Can you provide related codes? make sure you hide sensitive information.

0 Likes 0 ·
MertCorekci avatar image MertCorekci Seth Du ♦ commented ·
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;
    }
0 Likes 0 ·
MertCorekci avatar image MertCorekci Seth Du ♦ commented ·
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);
    }
0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Seth Du ♦ commented ·

My I ask is "0" your Primary Catalog?

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

Yes it is, it works on google play

0 Likes 0 ·
MertCorekci avatar image
MertCorekci answered

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

2 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 ·

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.

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

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?

0 Likes 0 ·
litebox avatar image
litebox answered

@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?

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.