Mock Purchases

When testing important code that involves important data, such as a player’s money, it’s nice to be able to test that code with mock services. Currently, we kinda have to test it on an actual server instance.

I think it’d be cool if we could have mock purchases for testing in solo. For instance, I can assign a ROBUX and Tickets amount to each player. Then when I use the MarketplaceService to purchase a dev product, I will actually get the prompt and proper behavior instead of the current orange-text warning about being offline.

Maybe a case could be made for simply creating a ModuleScript to act as a mock service for the MarketplaceService? I’ve done this for the DataStoreService, but it seems a bit unreasonable for the MarketplaceService since the service might be used in many different scripts, whereas I usually only have 1 script accessing the DataStoreService.

I’d like to hear input from anyone on this. Maybe you guys have better ways of testing this?

15 Likes

I think it would be a good idea if the Test Server acts like Players are linked to accounts that have infinite money, and keep a cache of all items that have been bought (initially empty). If this system is in place, then we can also start the Test Server with a player, buy some items with our infinite Tx/R$, make the player leave, and then start another player with the same userId on the same Test Server instance, and then the server should remember through the cache which items that player bought. That would be incredibly useful for testing IMO, and similar setups can be made for other Services. (BadgeService, DataStoreService)

1 Like

I like your idea of the caching. Although I don’t think it should necessarily have infinite money since it would still be good to test cases where the player does not have enough money (e.g. displaying a message that they need ‘x’ more credits for an upgrade).

[quote]
I like your idea of the caching. Although I don’t think it should necessarily have infinite money since it would still be good to test cases where the player does not have enough money (e.g. displaying a message that they need ‘x’ more credits for an upgrade). [/quote]

I guess so, but I think cancelling the purchase through the pop-up has the same effect anyway. (Otherwise we would be able to abuse it to approximate how much money someone has and that’s never a good thing :P)

While working on this feature we’ve come up with couple possible ways of allowing mock purchases. We appreciate your opinion on what is important. That said, could you please answer the following question.

What mock purchases are needed for?

  • Developer Products
  • Clothing Assets, Body Parts and Gear
  • All of them

0 voters

Clarification. The second choice in the poll means everything what is not a dev product

Do “developer products” include gamepasses?

There isn’t a point for gamepasses (unless you mean other peoples???), because you already own them once you create them

Isn’t that the point? In a testing environment, ideally you would want to be able to test gamepass purchases too.

4 Likes

I want to make sure my game logic handles purchasing gamepasses for my game correctly. It doesn’t matter if I already own them – I want the game to be told “he just bought this gamepass” as if I just finished buying it and closed out of the purchase prompt so I can check to make sure the game awards them the rewards associated with the gamepass without having to rejoin.

And regarding the poll, mock purchases should work with every paid asset type. Even if the majority of people only want to use it for developer products, you’re going to have people that want to test if clothing/etc purchases work. Anything other than compatibility with every paid asset type would be doing the feature an injustice and prevent it from being used to its fullest potential.

1 Like

What is there to test? You either have it or you don’t? (That sounded a bit rude sorry lol)

Edit: Yep… Didn’t think of all the uses of gamepasses :stuck_out_tongue:

Edit: Ninja’d

The game needs to award the perks from the gamepass to the player. Normally when they join you’d check to see if they owned it or not, and award them the perks then. But if they’re buying the gamepass while already in-game, they’d have to rejoin the game to get the perks if you only checked when they joined. To award them the perks from the gamepass right after they buy it, you need to have code that checks for when the prompted purchase is successfully completed and then award them the perks after it’s completed. That code can fail and needs to be able to be tested.

3 Likes

No, Dev Product is what you configure in Developer Products tab for your place. I’ve clarified the choices in the poll

Obviously all of them would be the best.
Starting with Dev Products might be the best, though.
Using assets is currently pretty easy, while dev products are a tiny bit… complicated.

(Can already test assets using a (free) model you just keep taking/untaking)

All,
Thank you for the great feedback! We’re moving forward with the software design and then will proceed with implementation. Will support Dev. Products, Game passes and everything else.

13 Likes

Awesome! I made this thread a year ago and I thought it just died out. Really happy to see that it will be implemented!

Everything what you ask us about never gets lost. We record all requests, ask to vote for them on Trello board or just fix them, if they are bugs. However, we do have limited resources, so not everything is getting implemented as soon as all of us would want. We’re working on shortening the response time, hopefully, you will notice it soon.

8 Likes

Yay! Finally don’t gotta pay myself to test something.

1 Like

Yes, this is so good!

1 Like

The struggle would be real once tix are gone. Just test with a price of 1 ticket. Not it would need to be 1 ROBUX.

This is more web-related than game related, so I doubt mock purchases can work with it, but another thing that’d be useful for developers to get for free in their own games are VIP servers, as per mentioned here