Hi Guys,
Apologies for my inexperience here. I know this question has been asked and I've read many answers which explain that (As I understand it) I need to parse the receipt from Apple before passing it to Playfab, but I'm having trouble understanding exactly how to do that.
Can anyone point me to any actual code for unity that parses the receipt which I'm currently getting from UnityEngine.Purchasing.Product.receipt and allows me to pass it here:
public void OnPurchasecomplete(UnityEngine.Purchasing.Product product) {
PlayFabClientAPI.ValidateIOSReceipt(new ValidateIOSReceiptRequest() {
CurrencyCode = product.metadata.isoCurrencyCode,
PurchasePrice = (int)(product.metadata.localizedPrice * 100),
// Pass in the receipt
ReceiptData = ???, // not sure how to get this exactly
I tried passing through product.receipt but it didn't work which I assume is because that's JSON format not base64?
The error was:
Validation failed: /Client/ValidateIOSReceipt: iTunes Sandbox validation result: 21002 (InvalidReceiptData) from https://sandbox.itunes.apple.com/verifyReceipt
I'm currently using codeless IAP.
Any help is much appreciated.