Is there a way to pass a “number of notes to store” value into the billing form from a separate input? I would like the user to be able to select a few options on the Settings page, then have a modal open up with the billing form pre-populated with the number of notes to store.
I’ve got the modal working fine, but I can’t figure out how to pass the calculated number of notes to store (based on the user’s selections) into the billing form itself.
First, store the amount of notes purchased in a table.
When you load the list of notes, also return the amount they’ve purchased. So you can either disable the button to add a new note or throw an error. And in the create function check if they are going over the limit.
When loading the settings page, load the amount they’ve purchased currently and the amount of notes they’ve created so far. And maybe add a +/- control to allow them to add or remove from the their limit. Make appropriate checks here to make sure they don’t go below the number of notes they already have. For the billing function, check if they are purchasing less than the number of notes they’ve already created also.
In general, the frontend does checks to make the interface more user friendly. And the backend does the checks to make sure it’s not allowing invalid actions.
Am I correct in assuming that in this section/Tutorial the payment is just for practice? It seems “optional” in the sense that none of our backend logic tries to check for the # of notes paid for.