I have a shopping cart app, that upon submission of payment does several things on the backend in NodeJS:
- Checks for existing customer (creates one if new)
- Charges the customer for the items in the cart
- Logs the order
- Registers players for each event purchased
- Sends confirmation emails to players
- Routes them to the checkout-success page, and empties the cart (which is in ngStorage)
My problem is with the last step. I'm not sure how to get the #/checkout-success route to load, as my code is incorrect:
var saveRegistrations = function(registrations, req, res) {
Registration
.collection.insert(registrations).then(function(r) {
console.log("Successfully saved registrations!",r.insertedCount);
res.redirect("#/checkout-sucess").json(registrations);
})
.catch(function(err) {
console.log(err.stack);
});
I already have the checkout-success.html file created, as well as the controller and have the route setup like I do my other angular routes in the app.js file. How can I send the user to this route and send that registrations JSON data along with it so I can finish things?
via user3561890
No comments:
Post a Comment