fix(donate): implement donate page
This commit is contained in:
committed by
mrugesh
parent
5609a1303e
commit
e4590fed5c
@ -170,16 +170,6 @@ export default function donateBoot(app, done) {
|
||||
};
|
||||
|
||||
return Promise.resolve(user)
|
||||
.then(nonDonatingUser => {
|
||||
const { isDonating } = nonDonatingUser;
|
||||
if (isDonating) {
|
||||
throw {
|
||||
message: `User already has active donation(s).`,
|
||||
type: 'AlreadyDonatingError'
|
||||
};
|
||||
}
|
||||
return nonDonatingUser;
|
||||
})
|
||||
.then(createCustomer)
|
||||
.then(customer => {
|
||||
return duration === 'onetime'
|
||||
@ -194,10 +184,7 @@ export default function donateBoot(app, done) {
|
||||
})
|
||||
.then(createAsyncUserDonation)
|
||||
.catch(err => {
|
||||
if (
|
||||
err.type === 'StripeCardError' ||
|
||||
err.type === 'AlreadyDonatingError'
|
||||
) {
|
||||
if (err.type === 'StripeCardError') {
|
||||
return res.status(402).send({ error: err.message });
|
||||
}
|
||||
return res
|
||||
|
Reference in New Issue
Block a user