public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
/*
뒤끝 영수증 검증 처리
*/
BackendReturnObject validation = Backend.Receipt.IsValidateGooglePurchase ( args.purchasedProduct.receipt , "receiptDescription", false);
// 영수증 검증에 성공한 경우
if(validation.IsSuccess())
{
// 구매 성공한 제품에 대한 id 체크하여 그에 맞는 보상
// A consumable product has been purchased by this user.
if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable, StringComparison.Ordinal))
{
Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
// The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
ScoreManager.score += 100;
}
// Or ... a non-consumable product has been purchased by this user.
else if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable, StringComparison.Ordinal))
{
Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
// TODO: The non-consumable item has been successfully purchased, grant this item to the player.
}
// Or ... a subscription product has been purchased by this user.
else if (String.Equals(args.purchasedProduct.definition.id, kProductIDSubscription, StringComparison.Ordinal))
{
Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
// TODO: The subscription item has been successfully purchased, grant this to the player.
}
}
// 영수증 검증에 실패한 경우
else
{
// Or ... an unknown product has been purchased by this user. Fill in additional products here....
Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
}
// Return a flag indicating whether this product has completely been received, or if the application needs
// to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
// saving purchased products to the cloud, and when that save is delayed.
return PurchaseProcessingResult.Complete;
}
뒤끝 개발자 문서에서 가져온 예시입니다.
ProcessPurchase(PurchaseEventArgs args) 메서드를 이용해서 검증을 하는건 알겠는데,
이 메서드를 호출할때 인자는 어떤것을 넣어줘야 하나요? args에 뭐가 들어가는지 모르겠습니다