Gift Subscriptions Promo (#8270)

* WIP(promo): buy-1-get-1 subs

* WIP(subscriptions): Slack integration

* feat(Slack): notify on sub buy
This commit is contained in:
Sabe Jones
2016-12-08 18:08:56 -08:00
committed by GitHub
parent 5efe5b7b10
commit f85f2a0c6d
6 changed files with 63 additions and 4 deletions

View File

@@ -139,12 +139,16 @@ api.checkoutSuccess = {
method = 'createSubscription';
}
data.paymentMethod = 'Gift';
data.paymentMethod = 'PayPal';
data.gift = gift;
}
await paypalPaymentExecute(paymentId, { payer_id: customerId });
await payments[method](data);
if (gift && gift.type === 'subscription' && gift.member._id !== data.user._id) {
gift.member = data.user;
await payments.createSubscription(data);
}
res.redirect('/');
},
};