Hi there.
I am working on getting Economy V2 configured for the Apple Store. When using the PlayFabEconomyAPI.RedeemAppleAppStoreInventoryItems call, I am getting back an error saying that I have a "malformed receipt".
Here is the code: public override void ValidateReceipt(PurchaseEventArgs eventArgs, Action successCallback, Action failedCallback) { validator = new CrossPlatformValidator(GooglePlayTangle.Data(), AppleTangle.Data(), Application.identifier);
try
{
IPurchaseReceipt[] receipts = validator.Validate(eventArgs.purchasedProduct.receipt);
foreach (IPurchaseReceipt receipt in receipts)
{
AppleInAppPurchaseReceipt appleReceipt = receipt as AppleInAppPurchaseReceipt;
string receiptData = eventArgs.purchasedProduct.receipt;
receiptData = receiptData.Replace("\"", "");
RedeemAppleAppStoreInventoryItemsRequest request = new RedeemAppleAppStoreInventoryItemsRequest
{
Receipt = JsonConvert.SerializeObject(appleReceipt),
Entity = new EntityKey
{
Id = PlayFabSettings.staticPlayer.EntityId,
Type = PlayFabSettings.staticPlayer.EntityType
}
};
PlayFabEconomyAPI.RedeemAppleAppStoreInventoryItems(request, successCallback, failedCallback);
}
}
catch (IAPSecurityException e)
{
Debug.LogException(e);
return;
}
catch (Exception e)
{
Debug.LogException(e);
}
}
I've also tried using eventArgs.purchasedProduct.receipt as the value for RedeemAppleAppStoreInventoryItemsRequest.Receipt.
Hoping someone can tell me what I might be doing wrong here. I'm unclear on what the Receipt value really should be. Any help would be greatly appreciated.
Thanks, ~N