In this game, a developer made a mistake in ProcessReceipt and caused it to error so people’s purchases were not being recorded and they were not receiving what they paid for. In the unfortunate case ProcessReceipt errors, Roblox should not grant the purchase. Here’s a video demonstrating the issue in Studio, it also happens in a live game as well:
Game link is uncopylocked but you can also grab a file here: repro.rbxl (23.5 KB)
Expected Behavior
When the process receipt callback errors at any point, the purchase should not go through.
Actual Behavior
When the callback errors, the purchase goes through, robux is taken and is accounted as a transaction for the owner of the developer product.
Issue Area: Engine Issue Type: Other Impact: Very High Frequency: Constantly Date First Experienced: 2021-09-19 00:09:00 (+02:00) Date Last Experienced: 2021-09-23 00:09:00 (+02:00)
On an alternative note, this has been like this forever. I suspect if Roblox did this, a lot of developer purchases would be granted, but not processed, so effectively Roblox would lose out on some currency sink, and certain games may need to be updated to fix it.
In all likelihood there’s both types of games. Some games are unintentionally “scamming” users as well, and in my opinion it’s better for a purchase not to go through but be granted than a purchase to go through and not be granted.
If this is intended behavior, there should be a request to change this! What I recognized as a bug is too ambiguous for anyone to understand that it is intentional.
It is odd that roblox does not automatically handle these errors and that the default type on an error seems to be granted. However it is explicitly documented to wrap all handler code within a pcall (see below) for this specific reason. I do think that roblox should probably handle the errors that are thrown directly as well though as this is pretty odd behavior.
Isn’t this intended behavior? A purchase will generally always go through unless there’s an issue with the Robux transaction, but that doesn’t mean it’s actually been processed.
For a purchase to be marked as processed, you have to specifically return PurchaseGranted or Roblox will keep calling the callback until it successfully does. If a purchase doesn’t get processed within 3 days the Robux will get refunded automatically iirc, so in a way Roblox already handles failed purchases somewhat gracefully.
That said, I do think Roblox could improve the purchasing UX and for example show a message if a purchase fails or takes longer than usual to process to make things less confusing for the user.
For a purchase to be marked as processed, you have to specifically return PurchaseGranted or Roblox will keep calling the callback until it successfully does. If a purchase doesn’t get processed within 3 days the Robux will get refunded automatically iirc, so in a way Roblox already handles failed purchases somewhat gracefully.
In this case the ProcessReceipt function errors and the purchase goes through and ProcessReceipt does not get called more than once from my testing so it probably means it was also granted.
Actually I was wrong, it does end up being called more than once, I did a bit more testing.
Thanks for the detailed bug report, we appreciate it.
The behavior reported on the bug report is indeed intended. On the Roblox end, a purchase is considered completed if we are able to process the payment and store the receipt successfully. After that point, it is up to the developer to grant the product. Details may be found in the DevHub article linked in the post marked above as Solution.