diff --git a/routes/payments/blockonomics.js b/routes/payments/blockonomics.js index 6a14873..c889479 100644 --- a/routes/payments/blockonomics.js +++ b/routes/payments/blockonomics.js @@ -41,10 +41,10 @@ router.get('/checkout_return', async (req, res, next) => { // send the email with the response // TODO: Should fix this to properly handle result common.sendEmail(req.session.paymentEmailAddr, 'Your payment with ' + config.cartTitle, common.getEmailTemplate(paymentResults)); - res.status(200).json({ err: '' }); + res.status(200).json({ err: '' }); }catch(ex){ console.info('Error updating status success blockonomics', ex); - res.status(200).json({ err: 'Error updating status' }); + res.status(200).json({ err: 'Error updating status' }); } return; } @@ -65,10 +65,10 @@ router.get('/checkout_return', async (req, res, next) => { return; } res.status(200).json({ err: 'Payment not final' }); - console.info('Payment not final blockonomics', address); + console.info('Payment not final blockonomics', address); }); -router.post('/checkout_action', (req, res, next) => { +router.post('/checkout_action', (req, res, next) => { const blockonomicsConfig = common.getPaymentConfig(); const config = req.app.config; const db = req.app.db; @@ -95,6 +95,7 @@ router.post('/checkout_action', (req, res, next) => { orderItemCount: req.session.totalCartItems, orderProductCount: req.session.totalCartProducts, orderEmail: req.session.customerEmail, + orderCompany: req.session.customerCompany, orderFirstname: req.session.customerFirstname, orderLastname: req.session.customerLastname, orderAddr1: req.session.customerAddress1, @@ -117,15 +118,15 @@ router.post('/checkout_action', (req, res, next) => { const newId = newDoc.insertedId; // add to lunr index indexOrders(req.app) - .then(() => { + .then(() => { // set the order ID in the session, to link to it from blockonomics payment page blockonomicsParams.pendingOrderId = newId; req.session.blockonomicsParams = blockonomicsParams; - res.redirect('/blockonomics_payment'); - }); - }); + res.redirect('/blockonomics_payment'); + }); + }); }); - }); + }); }); module.exports = router;