It says it is prompted every time the user is prompted also. "or even after they have bought something else"
I will store a pending donations value in their datastore so if they leave while purchasing, it should have their last purchase date and let them know of the possible refund.
Ok, that part is up to you anyway.
These are currently the products
ignore the refund one
Donating 43263
Prompting "400752821" for 10000 Robux purchase, 33263 Robux remaining
Prompting "400752821" for 10000 Robux purchase, 23263 Robux remaining
Prompting "400752821" for 10000 Robux purchase, 13263 Robux remaining
Prompting "400752821" for 10000 Robux purchase, 3263 Robux remaining
Prompting "400751866" for 2000 Robux purchase, 1263 Robux remaining
Prompting "400751588" for 1000 Robux purchase, 263 Robux remaining
Prompting "400749495" for 250 Robux purchase, 13 Robux remaining
Prompting "400745223" for 10 Robux purchase, 3 Robux remaining
Prompting "400744499" for 2 Robux purchase, 1 Robux remaining
Prompting "400743916" for 1 Robux purchase, 0 Robux remaining
About the yielding part, is it going to wait for return before calling it again or will it be called consecutively even if it is waiting on a result?
That’s a weird approach, won’t it prompt each one of those, and have to manually be accepted? You should just do tiers of payments. Eg. 10 robux, 50, 100, 250, 500, 800, 1000, 2500, 5000, 10000
What do you mean? The user can choose exactly how much robux they would like to donate.
No inputed amount, just different tiers that the player can select. Exactly how much will prompt up 10 different payment boxes (correct me if this does not happen), confusing the player as it would look like he/she is making multiple payments.
You type an input and it would show beforehand what the payment would be as a list of orders. You click on the orders to make the payment
As a fellow Dev, I would say that it’s ok to ask for money dude, we put months if not years into our games and Yes Donations are fine.
Do you happen to know if products that were successfully purchased are handled again?
Successfully handled products are not handled again.
As for your last question, what I meant by making the functions yield was that you do something like this:
local completed, cancelled
-- do something to retrieve the current value or update values with a remote event or something
repeat wait() until completed
if cancelled then
return NotProcessedYet -- shortened
else
return PurchaseGranted
end
What I do now is I have a list that fills up with receipts for the user.
The list is cleared when purchases fail or complete.
It checks the list to see if the product is part of the purchase sequence and if it was granted then it would grant the purchase
Yep, that’s fine, my issue is with returning NotProceessed yet. As I said, unless the server gets sent information by the client real quick, NotProcessedYet will be returned – but if it is the last purchase, then the callback will not update the state to PurchaseGranted (as even if the client makes the decision to go forward with the purchase, the server won’t get updated in time before the final ProcessReceipt callback runs).
Yes but the callback is continuously called when they are prompted and buy so when the final purchase is made it will return as processed
How often is it continually called, though?
It is likely they will leave as soon as they are done (therefore closing the server) which means the purchases may not be granted in time.
I’ve got no idea about the frequency so I guess I’ll leave it at that. Do what you think is best
it is called multiple times when they buy an item
Yes but what is the frequency of those calls? Because if it is low (if they aren’t called very often) the donator could leave the server (making it shutdown automatically) and as a result the purchases may not get processed within 3 days.
Imagine a car that beeps every five minutes while being driven. When the person gets out of the car, the beeping stops. The beeping has a fairly low frequency, as it happens once every 5 minutes. If it had a higher frequency, it might happen once every 5 seconds. The beeping is the ProcessReceipt callback being fired, and the car is the server. The callback can only be fired when the car (server) is running, but it needs meet a “quota” of beeps after the person stops driving (before the person gets out of the car, stopping the beeps entirely). Gtg but that’s the message I’m trying to get across.
No it just runs everything at the same time
Yes but I’m talking about what happens to a single purchase if NotProcessedYet is returned.
The player may leave the game during the interval between all of their purchases being accepted (by the player) and the next ProcessReceipt call.
If they are the only one in the server, the server may shutdown before the purchases get processed.