Browse Source

return payment error if exists

bugfix/timeout-logging
Evan Feenstra 5 years ago
parent
commit
ad90951e64
  1. 14
      api/controllers/invites.ts
  2. 14
      dist/api/controllers/invites.js
  3. 2
      dist/api/controllers/invites.js.map

14
api/controllers/invites.ts

@ -41,11 +41,15 @@ const payInvite = async (req, res) => {
// if (dbInvite.status != invite.invite_status) {
// dbInvite.update({ status: invite.invite_status })
// }
console.log(response)
res.status(200)
res.json({ success: true, response: { invite: jsonUtils.inviteToJson(dbInvite) } })
res.end()
if(response.payment_error) {
res.status(200)
res.json({success:false, error:response.payment_error})
res.end()
} else {
res.status(200)
res.json({ success: true, response: { invite: jsonUtils.inviteToJson(dbInvite) } })
res.end()
}
}
const onFailure = (response) => {

14
dist/api/controllers/invites.js

@ -45,10 +45,16 @@ const payInvite = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
// if (dbInvite.status != invite.invite_status) {
// dbInvite.update({ status: invite.invite_status })
// }
console.log(response);
res.status(200);
res.json({ success: true, response: { invite: jsonUtils.inviteToJson(dbInvite) } });
res.end();
if (response.payment_error) {
res.status(200);
res.json({ success: false, error: response.payment_error });
res.end();
}
else {
res.status(200);
res.json({ success: true, response: { invite: jsonUtils.inviteToJson(dbInvite) } });
res.end();
}
});
const onFailure = (response) => {
res.status(200);

2
dist/api/controllers/invites.js.map

@ -1 +1 @@
{"version":3,"file":"invites.js","sourceRoot":"","sources":["../../../api/controllers/invites.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,gCAA6E;AAE7E,MAAM,YAAY,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACvC,MAAM,EACL,aAAa,EACX,GAAG,GAAG,CAAC,IAAI,CAAA;IACd,MAAM,MAAM,GAAG;QACd,MAAM,EAAE;YACP,GAAG,EAAE,aAAa;SAClB;KACD,CAAA;IAED,SAAS,SAAS;QACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;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