코드입니다.
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
Debug.Log("아이템 구매 가능 : "+args.purchasedProduct.availableToPurchase); // 정상
Debug.Log("영수증 검증 : " + args.purchasedProduct.receipt); // 정상
Enqueue(Backend.Receipt.IsValidateGooglePurchase, args.purchasedProduct.receipt, "receiptDescription", false, callback => // 여기가 976 라인
{
if (callback.IsSuccess())
{
Debug.Log("Receipt.IsValidateGooglePurchase : " + callback);
}
else
{
Debug.LogError("Receipt.IsValidateGooglePurchase : " + callback);
}
Debug.Log("영수증 검증(Google) 테스트 종료!!!!!");
});
// 뒤끝 영수증 검증 처리
BackendReturnObject validation = null;
#if UNITY_ANDROID || UNITY_EDITOR
validation = Backend.Receipt.IsValidateGooglePurchase(args.purchasedProduct.receipt, “receiptDescriptionGoogle”);
#elif UNITY_IOS
validation = Backend.Receipt.IsValidateApplePurchase(args.purchasedProduct.receipt, “receiptDescriptionApple”);
#endif
string msg = “”;
Debug.Log(“영수증 검증 중”);
// 영수증 검증에 성공한 경우
if (validation.IsSuccess())
{
// 구매 성공한 제품에 대한 id 체크하여 그에맞는 보상
// A consumable product has been purchased by this user.
if (String.Equals(args.purchasedProduct.definition.id, p_ID, StringComparison.Ordinal))
{
msg = string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id);
IAPManager.Instance.Purchase_Successed(true, p_ID);
Debug.Log(msg);
}
}
// 영수증 검증에 실패한 경우
else
{
// Or ... an unknown product has been purchased by this user. Fill in additional products here....
msg = string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id);
IAPManager.Instance.Purchase_Successed(false, p_ID);
Debug.Log(msg);
Debug.Log(validation);
}
// 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;
}