-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CatalogOffer.AvailableForPurchase always false coming #1115
Comments
Hi @KaalirajanChennaiGames - I'm moving this from a discussion to being an issue. |
Ahoy @KaalirajanChennaiGames ! I hope this message reaches you. I'd like to have you configure some logging settings. Please:
Then repeat the error, and share your logs here. Are you utilizing the |
Hi, Yes directly using the EcomInterface. i.e here I attached logs and methods: private void OnQueryOffers(ref QueryOffersCallbackInfo queryOffersCallbackInfo)
{
CatalogOffers.Clear();
Debug.Log("==OnQueryOffers QueryOffers callback. ResultCode=" + queryOffersCallbackInfo.ResultCode);
if (queryOffersCallbackInfo.ResultCode == Result.Success)
{
var getOfferCountOptions = new GetOfferCountOptions();
getOfferCountOptions.LocalUserId = EOSManager.Instance.GetLocalUserId();
var offerCount = EOSManager.Instance.GetEOSEcomInterface().GetOfferCount(ref getOfferCountOptions);
Debug.Log("OnQueryOffers offerCount==========>" + offerCount);
if(offerCount > 0)
{
for (int offerIndex = 0; offerIndex < offerCount; ++offerIndex)
{
var copyOfferByIndexOptions = new CopyOfferByIndexOptions();
copyOfferByIndexOptions.LocalUserId = EOSManager.Instance.GetLocalUserId();
copyOfferByIndexOptions.OfferIndex = (uint)offerIndex;
var copyOfferByIndexResult = EOSManager.Instance.GetEOSEcomInterface().CopyOfferByIndex(ref copyOfferByIndexOptions, out var catalogOffer);
switch (copyOfferByIndexResult)
{
case Result.Success:
case Result.EcomCatalogOfferPriceInvalid:
case Result.EcomCatalogOfferStale:
Debug.Log("\n================================================="
+ "\nofferIndex:" + offerIndex
+ "\nServerIndex:" + catalogOffer?.ServerIndex
+ "\ncatalogOffer.Id:" + catalogOffer?.Id
+ "\ncatalogOffer.TitleText:" + catalogOffer?.TitleText
+ "\ncatalogOffer.PriceResult:" + catalogOffer?.PriceResult
+ "\nCurrentPriceAsString:" + GetCurrentPriceAsString(catalogOffer)
+ "\nOriginalPriceAsString:" + GetOriginalPriceAsString(catalogOffer)
+ "\nCatalogNamespace:" + catalogOffer?.CatalogNamespace
+ "\nDescriptionText:" + catalogOffer?.DescriptionText
+ "\nLongDescriptionText:" + catalogOffer?.LongDescriptionText
+ "\nDiscountPercentage:" + catalogOffer?.DiscountPercentage
+ "\nEffectiveDateTimestamp:" + catalogOffer?.EffectiveDateTimestamp
+ "\nReleaseDateTimestamp:" + catalogOffer?.ReleaseDateTimestamp
+ "\nPurchaseLimit:" + catalogOffer?.PurchaseLimit
+ "\nDecimalPoint:" + catalogOffer?.DecimalPoint
+ "\nCurrencyCode:" + catalogOffer?.CurrencyCode
+ "\nAvailableForPurchase:" + catalogOffer?.AvailableForPurchase
+ "\n====================================================="
);
CatalogOffers.Add(catalogOffer.Value);
break;
default:
Debug.Log($"Offer {offerIndex} invalid: {copyOfferByIndexResult}");
break;
}
}
currencyCode = CatalogOffers[0].CurrencyCode;
CheckOfferOwnership();
}
CatalogOffersDirty = true;
GameManager.instance.gotStoreProductdetails = true;
}
else
{
Debug.LogError("Error calling QueryOffers: " + queryOffersCallbackInfo.ResultCode);
}
} if (catalogOffer.AvailableForPurchase) //Here always false
{
EpicGamesManager.instance.Checkout(catalogOffer); // product clicked
} public void Checkout(CatalogOffer catalogOffer)
{
Debug.Log("======Checkout() called for ======" + catalogOffer.Id);
CheckoutEntry checkoutEntry = new CheckoutEntry();
checkoutEntry.OfferId = catalogOffer.Id;
Debug.Log("\nOfferId=>" + checkoutEntry.OfferId);
CheckoutOptions checkoutOptions = new CheckoutOptions();
checkoutOptions.LocalUserId = EOSManager.Instance.GetLocalUserId();
checkoutOptions.Entries = new CheckoutEntry[] { checkoutEntry };
Debug.Log("checkoutOptions.LocalUserId=>" + checkoutOptions.LocalUserId);
Debug.Log("checkoutEntry.OfferId=>" + checkoutEntry.OfferId);
Dictionary<string, string> clientData = new Dictionary<string, string>();
clientData.Add("OfferId", catalogOffer.Id);
clientData.Add("TitleText", catalogOffer.TitleText);
EOSManager.Instance.GetEOSEcomInterface().Checkout(ref checkoutOptions, clientData, OnCheckout);
//==============Success Purchase Hardcode========
//CheckoutCallbackInfo callbackInfo = new CheckoutCallbackInfo();
//callbackInfo.ResultCode = Result.Success;
//callbackInfo.ClientData = clientData;
//callbackInfo.TransactionId = catalogOffer.Id;
//OnCheckout(ref callbackInfo);
//==============Failed Purchase Hardcode========
//CheckoutCallbackInfo callbackInfo = new CheckoutCallbackInfo();
//callbackInfo.ResultCode = Result.Canceled;
//callbackInfo.ClientData = clientData;
//callbackInfo.TransactionId = catalogOffer.Id;
//OnCheckout(ref callbackInfo);
//=================================================
}
[issue_all_logs.txt](https://github.com/user-attachments/files/18701645/issue_all_logs.txt) |
Wild guessing, from Epic documentation here: https://dev.epicgames.com/docs/api-ref/structs/eos-ecom-catalog-offer
I noticed your Purchase Limit returned is 0. I think this needs to be a negative number if it's meant to be infinitely purchaseable, or 1 if it's meant to be purchased once. I do not know where in the UI this value is configured. Trying to dig in to that. |
One more bit of advice. There's a switch statement handling |
Discussed in https://github.com/PlayEveryWare/eos_plugin_for_unity/discussions/1113
Originally posted by KaalirajanChennaiGames February 5, 2025
Used version: 3.3.3 & 3.3.5
EOSManager.Instance.StartLoginWithLoginTypeAndToken()
working fine. (Login)EOSManager.Instance.GetEOSEcomInterface().QueryOffers()
working fine. (Get all IAP prodcucts/offers)EOSManager.Instance.GetEOSEcomInterface().GetOfferCount()
working fine. (offer count: 11)EOSManager.Instance.GetEOSEcomInterface().Checkout()
Not working fine.Here
CatalogOffers[index].AvailableForPurchase
always false. why?If I try to
CheckOut()
, the Result Code always "NotConfigured". why?Note: Build was uploaded in Dev & Stag(but not submitted to review)
#EOS-2386
The text was updated successfully, but these errors were encountered: