Im making Unity IAP with the playfab receipt validation. In ProcessPurchase() in below script, It returns PurchaseProcessingResult.Complete; at the bottom of my script. But There is the playfab receipt validation API call. So i think, should it be return PurchaseProcessingResult.Pending first, and playfab validation API return success callback, and return or change that result to Complete, isn't it?
In other word, It's ok to return PurchaseProcessingResult.Complete first when It is not sure the purchase would pass through the receipt validation?
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
var googleReceipt = GooglePurchase.FromJson(args.purchasedProduct.receipt);
PlayFabClientAPI.ValidateGooglePlayPurchase(new ValidateGooglePlayPurchaseRequest()
{
CurrencyCode = args.purchasedProduct.metadata.isoCurrencyCode,
PurchasePrice = (uint)(args.purchasedProduct.metadata.localizedPrice * 100),
ReceiptJson = googleReceipt.PayloadData.json,
Signature = googleReceipt.PayloadData.signature
}, result =>
{
Debug.Log("Validation successful!");
}, error =>
{
Debug.Log("Validation failed");
}
);
return PurchaseProcessingResult.Complete; // This parts should be PurchaseProcessingResult.pending?
}