question

Lukasz Balukin avatar image
Lukasz Balukin asked

/Client/PurchaseItem returns 500 InternalServerError when attempting to purchase RM-priced bundle and throws NRE on the server side

When attempting to purchase RM-priced bundle, it throws the error below:

Request:

(Some elements are redacted but I assume you can retrieve it with RequestId provided in response)

{
    "CatalogVersion": "<REDACTED_STORE_NAME>",
    "CharacterId": null,
    "CustomTags": null,
    "ItemId": "<REDACTED_BUNDLE_NAME>",
    "Price": 199,
    "StoreId": "<REDACTED_STORE_ID>",
    "VirtualCurrency": "RM",
    "AuthenticationContext": null
}

Response:

{
    "code": 500,
    "status": "InternalServerError",
    "retryAfterSeconds": null,
    "error": "InternalServerError",
    "errorCode": 1110,
    "errorMessage": "An unexpected error occured while processing the request : Object reference not set to an instance of an object.",
    "errorHash": "e8965e1b70585c6ef95f84bb7c3d3daf",
    "errorDetails": {
        "RequestID": [
            "1-63286541-219597f41cfeebdb6a8a5448"
        ],
        "StackTrace": [
            "see below"
        ]
    }
}

Stack trace returned by server:

   at PlayFab.Services.PurchasingService.PurchaseSingleItemAsync(UInt64 userId, UInt64 titleId, String catalogVersion, String storeId, String catalogItemId, String vc, Int32 price, Dictionary`2 customTags, Nullable`1 characterId, DateTime timestamp, CancellationToken cancellationToken) in /home/runner/work/pf-main/pf-main/Server/UberNetServices/Purchasing/PurchasingService.cs:line 1277
   at PlayFab.MainServer.Controllers.GameClientController.<>c__DisplayClass66_0.<<PurchaseItem>b__0>d.MoveNext() in /home/runner/work/pf-main/pf-main/Server/MainServer/Controllers/GameClientController.cs:line 4736
--- End of stack trace from previous location ---
   at PlayFab.Services.Locking.LockExecutor`1.ExecuteWithLockAsync[TResult](T owner, Func`1 workMethod, Boolean waitForLease, CancellationToken cancellationToken) in /home/runner/work/pf-main/pf-main/Server/UberNetServices/Locking/LockedExecutionService.cs:line 84
   at PlayFab.MainServer.Controllers.CommonShared.ExecuteEconomyOpInControllerAsync[T](UInt64 titleId, UInt64 playFabId, Func`1 op, CancellationToken cancellationToken) in /home/runner/work/pf-main/pf-main/Server/MainServer/ControllerShared/CommonShared.cs:line 66
   at PlayFab.MainServer.Controllers.GameClientController.PurchaseItem(PurchaseItemRequest request) in /home/runner/work/pf-main/pf-main/Server/MainServer/Controllers/GameClientController.cs:line 4737
   at lambda_method21246(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

The bundle was previously an item and was converted to bundle using admin panel conversion option.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Lukasz Balukin avatar image Lukasz Balukin commented ·

Changing bundle to an item changes nothing.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ commented ·

This is a known issue. Our engineering team is currently investigating on this issue. I will let you know if there is any update from the team. Your patience is appreciated.

0 Likes 0 ·
Lukasz Balukin avatar image Lukasz Balukin commented ·

Is this a new problem that affects everyone or did I somehow do something different that triggered this error just for me?

It makes us reconsider using Playfab services becaue it is somehow worrying that such critical feature as purchasing items can break with no incident information on status page and I have to ask on forums why the service is not available.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Lukasz Balukin commented ·

This API does not support Real Money purchase. As you may see that the request body is asking for "VirtualCurrency", not real money (RM). Were you able to call PurchaseItem with "RM" successfully before? Our engineering team is going to fix this issue by returning an appropriate error when "RM" is used.

0 Likes 0 ·
Lukasz Balukin avatar image Lukasz Balukin Rick Chen ♦ commented ·

No, I only started implementing it now but your documentations describes using RM valued items here:

https://learn.microsoft.com/en-us/gaming/playfab/features/economy/tutorials/stores-and-sales#defining-a-real-money-store

which mentions "You should only charge RM for items of significant value, or bundles/containers with premium currency." which I'm attempting to do.

It is also further mentioned here by your support person:

https://community.playfab.com/questions/60237/is-it-necessary-that-the-price-in-rm-matches-the-p.html

as a way to increase Value-to-date counter for purchases worth real money.

I'm attempting to add a RM-priced item that is used to buy virtual currency. If this documentation is outdated, what is the proper way to sell a playfab item that has real-money value that will increment player's lifetime value counter?

0 Likes 0 ·
Show more comments

1 Answer

·
Rick Chen avatar image
Rick Chen answered

According to our engineering team, the error message has been fixed.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.