Skip to content
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

UnityBeamablePurchaser issues with ErrorCode and not calling Finish #3742

Open
allister-beamable opened this issue Oct 31, 2024 · 0 comments

Comments

@allister-beamable
Copy link
Contributor

Describe the bug

In some circumstances, whose root causes are often unclear, UnityBeamablePurchaser can sometimes fail to finish a purchase transaction, leading to the purchase receipt being "stuck" in the provider as an unfulfilled receipt. This appears to only happen for iOS and not for other mobile purchases.

In addition, and perhaps as an exacerbating factor, UnityBeamablePurchaser reacts differently if it gets certain PlatformRequesterExceptions as opposed to ErrorCodes. This could incorrectly prevent the retry logic from kicking in.

To Reproduce

There are no reliable repro steps. This has only occurred "in the wild".

Expected behavior

  • Purchases get cleared from Apple's iTunes system eventually, even if a weird failure occurs in game client code the first time Beamable attempts to fulfill the purchase.

Actual behavior

  • Somehow receipts get stuck in an unfulfilled state, from the perspective of iTunes, and this prevents players from purchasing the same SKU again later, resulting in an error saying "hacking attempt" due to unexpected receipts in the payload.

Metadata

  • SDK version: Beamable Unity SDK 1.19.21
  • Operating System: iOS players

Additional context

The Game Maker who reported this issue was able to make some changes to improve things. Namely, they added a case to the Error handler in UnityBeamablePurchaser.FulfillTransaction that converts PlatformRequesterException to ErrorCode:

            if (err == null)
            {
               var platform_requester_exception = ex as PlatformRequesterException;
               if (platform_requester_exception?.Error == null)
               {
                  return;
               }

               err = new ErrorCode(platform_requester_exception.Error);
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant