nl_tokens: Checks if a purchase might be in the refund period whether refundable or not .
pl_tokens: function maybeWithinRefundPeriod ( purchase ) { if ( isRefundable ( purchase ) ) { return <mask> ; } // This looks at how much time has elapsed since the subscription date, // which should be relatively reliable for new subscription refunds, but // not renewals. To be completely accurate, this would need to look at the // transaction date instead, but by definition this function needs to work // in scenarios where we don't know exactly which transaction needs to be // refunded. // Another source of uncertainty here is that it relies on the user's // clock, which might not be accurate. return ( 'undefined' !== typeof purchase . subscribedDate && 'undefined' !== typeof purchase . refundPeriodInDays && moment ( ) . diff ( moment ( purchase . subscribedDate ) , 'days' ) <= purchase . refundPeriodInDays ) ; }