mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-18 01:42:20 +00:00
Paypal ipn options (#8713)
* Added more acceptable ipn cancelation options * Fixed lint issue * Fixed spelling issue
This commit is contained in:
parent
613f51b08d
commit
4553a411f6
1 changed files with 8 additions and 1 deletions
|
|
@ -231,7 +231,14 @@ api.ipn = async function ipnApi (options = {}) {
|
|||
|
||||
let {txn_type, recurring_payment_id} = options;
|
||||
|
||||
if (['recurring_payment_profile_cancel', 'subscr_cancel'].indexOf(txn_type) === -1) return;
|
||||
let ipnAcceptableTypes = [
|
||||
'recurring_payment_profile_cancel',
|
||||
'recurring_payment_failed',
|
||||
'recurring_payment_expired',
|
||||
'subscr_cancel',
|
||||
'subscr_failed'];
|
||||
|
||||
if (ipnAcceptableTypes.indexOf(txn_type) === -1) return;
|
||||
// @TODO: Should this request billing date?
|
||||
let user = await User.findOne({ 'purchased.plan.customerId': recurring_payment_id }).exec();
|
||||
if (user) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue