mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
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:
@@ -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('/');
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user