I have a nicely working shopping cart system now. First off, thanks to those who helped me. And thanks to the Wappler team for forcing me to do this from scratch instead of a ready made extension.
Have I done everything I need to do to move on to the next stage, payment gateway? Am I collecting all the important information I need? I hope I can do this next step. Get ready for lots of questions.
If you’ve dealt with the API connector before in Wappler then the Stripe tutorial isn’t as full on as it looks. There’s a couple of things you’ll need to store in your DB for Stripe but it’s all in the tutorial (hopefully)
I have a table called order_lines where each line of the order gets inserted to and references the order id. I then do a SUM server side of all of the order lines to calculate the total price which gets sent to Stripe. How do you have your DB setup?
OMG, I’m screwed. I fell so stupid right about now. I don’t even know where to start or what questions to ask. I only have five more days to figure out if I can do this before I have to turn down the project.
I so appreciate your help, @max_gb. Wish I could be more help to you to help me.
Yeah I’m aware of that. In our case none of our clientele is that savvy. We are a small city and I pretty much know 90% of the ticket purchasers personally. It is a valid point though that others should be aware of.
That's why you use the values from the local storage to only show the info to the users.
You don't use this value in the checkout process, as for the checkout you get the info from a database query and send it to the payment API in a server action.
This query is for the product and price. That's why you need to do a SUM server side to avoid people from tampering with the price on the browser console.
That's what is missing in the tutorial ... maybe it should be in both tutorials. What database and what query? According to the shopping cart tutorial there is no mention of a database. Then in Max's tutorial it starts off with saying my query may be different than his. There is nothing to query! Nothing has been added to a database. How and what does data get added to a database?
The only data table I have is the products.
If someone can just fill in that gap I could possibly move on with Max's tutorial. I really want that to work.
Well it's the same table Brad... Just query it before sending the data to the API.
My tutorial only shows how to build your shopping cart functionality, not the checkout.
Query it for what? What info am I trying to get on this query? Can someone supply a sample of this query, maybe that will help understand what this query is to achieve?
I know your tutorial doesn’t explain the check out and Max’s doesn’t explain the cart part. There seems to be a big chunk of information missing on how to get from yours to Max’s.
Brad,
You get the product IDs and the quantity from the local storage and send them to your server action and filter the database query (your product tables) to return the price(s). You use these results in the checkout API