코드리스 IAP 영수증 검증 못하나요?
로그캣 찍어보면 영수증 나오던데
이걸 어떻게 코드상으로 받아오는지 모르겠는데...
어떻게 받아올수 있는건가요?
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
{
bool validPurchase = true; // Presume valid for platforms with no R.V.
// Unity IAP's validation logic is only included on these platforms.
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
// Prepare the validator with the secrets we prepared in the Editor
// obfuscation window.
var validator = new CrossPlatformValidator(GooglePlayTangle.Data(),
AppleTangle.Data(), Application.identifier);
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
// Prepare the validator with the secrets we prepared in the Editor
// obfuscation window.
var validator = new CrossPlatformValidator(GooglePlayTangle.Data(),
AppleTangle.Data(), Application.identifier);
try
{
// On Google Play, result has a single product ID.
// On Apple stores, receipts contain multiple products.
var result = validator.Validate(args.purchasedProduct.receipt);
// For informational purposes, we list the receipt(s)
Debug.Log("Receipt is valid. Contents:");
foreach (IPurchaseReceipt productReceipt in result)
{
//
{
// On Google Play, result has a single product ID.
// On Apple stores, receipts contain multiple products.
var result = validator.Validate(args.purchasedProduct.receipt);
// For informational purposes, we list the receipt(s)
Debug.Log("Receipt is valid. Contents:");
foreach (IPurchaseReceipt productReceipt in result)
{
//
Debug.Log("ID : "+productReceipt.productID);
Debug.Log("Data : " + productReceipt.purchaseDate);
Debug.Log("TransactionID : " + productReceipt.transactionID);
}
}
catch (IAPSecurityException)
{
Debug.Log("Invalid receipt, not unlocking content");
validPurchase = false;
}
#endif
Debug.Log("Data : " + productReceipt.purchaseDate);
Debug.Log("TransactionID : " + productReceipt.transactionID);
}
}
catch (IAPSecurityException)
{
Debug.Log("Invalid receipt, not unlocking content");
validPurchase = false;
}
#endif
if (validPurchase)
{
ShopManager.instance.Dia1200();
{
ShopManager.instance.Dia1200();
// Unlock the appropriate content here.
}
}
return PurchaseProcessingResult.Complete;
}
}
여기서 받아올 수 있을줄 알았는데
뭔가 더 추가가 필요한가요?
영수증 검증만 하면 개발 끝나는데 이것때문에 몇주 고생이네요 ㅜ
서버로 레시피보내서 검증해
그러니까 서버에 보낼 값을 어떻게 받아오는지 몰라서... 저 함수 넣고 IAP버튼으로 인앱결제하면 함수 실행이 안된던데 조금만 더 풀어서 설명좀 해주세요