Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Moffat committed Jun 15, 2019
1 parent 291a044 commit a4e0f03
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routes/payments/authorizenet.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.post('/checkout_action', (req, res, next) => {
}
};

axios.post(authorizeUrl, chargeJson, {responseType: 'text'})
axios.post(authorizeUrl, chargeJson, { responseType: 'text' })
.then((response) => {
// This is crazy but the Authorize.net API returns a string with BOM and totally
// screws the JSON response being parsed. So many hours wasted!
Expand All @@ -43,7 +43,7 @@ router.post('/checkout_action', (req, res, next) => {
if(!txn){
console.log('Declined request payload', chargeJson);
console.log('Declined response payload', response.data);
res.status(400).json({err: 'Your payment has declined. Please try again'});
res.status(400).json({ err: 'Your payment has declined. Please try again' });
return;
}

Expand Down Expand Up @@ -117,22 +117,22 @@ router.post('/checkout_action', (req, res, next) => {
common.sendEmail(req.session.paymentEmailAddr, `Your payment with ${config.cartTitle}`, common.getEmailTemplate(paymentResults));

// redirect to outcome
res.status(200).json({orderId: newId});
res.status(200).json({ orderId: newId });
}else{
// redirect to failure
req.session.messageType = 'danger';
req.session.message = 'Your payment has declined. Please try again';
req.session.paymentApproved = false;
req.session.paymentDetails = `<p><strong>Order ID: </strong>${newId}
</p><p><strong>Transaction ID: </strong> ${txn.transHash}</p>`;
res.status(400).json({err: true, orderId: newId});
res.status(400).json({ err: true, orderId: newId });
}
});
});
})
.catch((err) => {
console.log('Error sending payment to API', err);
res.status(400).json({err: 'Your payment has declined. Please try again'});
res.status(400).json({ err: 'Your payment has declined. Please try again' });
});
});

Expand Down

0 comments on commit a4e0f03

Please sign in to comment.