question

palf avatar image
palf asked

Why does ValidateIOSReceiptRequest give the option of a CatalogVersion if it always defaults to the Primary Catalog

I am currently using the Unity SDK and am trying to validate an iOS purchase receipt. I have set the client catalog to one called iOS_Catalog and the CatalogVersion in ValidateIOSReceiptRequest to the same value. However when making a purchase on iOS I always receive the same error on client:

ERROR /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)

On the backend the transaction is recorded as successful and the user granted the virtual currency, which I can see in both the purchases section and the playStream.

I presume this error is triggered because the purchased product ID is not found in the main catalog. However I have verified the purchase id is valid and is correct on the Apple App Store and in our iOS_Catalog.

Why then is the option given to use a different catalog for Purchase Validation if it not used by PlayFab on the backend, or I am just doing something wrong?

This is the sample code we are using for the receipt validation:

//Create Request var request = new ValidateIOSReceiptRequest { //Set the catalog version CatalogVersion = "iOS_Catalog", // Pass in currency code in ISO format CurrencyCode = args.purchasedProduct.metadata.isoCurrencyCode, // Convert and set Purchase price PurchasePrice = (int)(args.purchasedProduct.metadata.localizedPrice * 100), // Pass in the receipt ReceiptData = appleReceipt.Payload };

Regards,

Neil

apissdks
10 |1200

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

1 Answer

·
palf avatar image
palf answered

Think we have solved this issue. All seems to be working now with Validating purchases, there was an error on one our environments that caused the issue, not the catalog validation. Please close this thread.

1 comment
10 |1200

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

Xiao Zha avatar image Xiao Zha commented ·

Glad to hear you solve the issue.

0 Likes 0 ·

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.