@@ -56,6 +56,15 @@ function hasPrivateRegistration( purchase ) {
56
56
return purchase . hasPrivateRegistration ;
57
57
}
58
58
59
+ /**
60
+ * Checks if a purchase can be cancelled.
61
+ * Returns true for purchases that aren't expired
62
+ * Also returns true for purchases whether or not they are after the refund period.
63
+ * Purchases included with a plan can't be cancelled.
64
+ *
65
+ * @param {Object } purchase
66
+ * @return {boolean }
67
+ */
59
68
function isCancelable ( purchase ) {
60
69
if ( isIncludedWithPlan ( purchase ) ) {
61
70
return false ;
@@ -101,10 +110,27 @@ function isRedeemable( purchase ) {
101
110
return purchase . isRedeemable ;
102
111
}
103
112
113
+ /**
114
+ * Checks if a purchase can be canceled and refunded.
115
+ * Purchases usually can be refunded up to 30 days after purchase.
116
+ * Domains and domain mappings can be refunded up to 48 hours.
117
+ * Purchases included with plan can't be refunded.
118
+ *
119
+ * @param {Object } purchase
120
+ * @return {boolean }
121
+ */
104
122
function isRefundable ( purchase ) {
105
123
return purchase . isRefundable ;
106
124
}
107
125
126
+ /**
127
+ * Checks if an expired purchase can be removed from a user account.
128
+ * Only domains and domain mappings can be removed.
129
+ * Purchases included with plan can't be removed.
130
+ *
131
+ * @param {Object } purchase
132
+ * @return {boolean }
133
+ */
108
134
function isRemovable ( purchase ) {
109
135
if ( isIncludedWithPlan ( purchase ) ) {
110
136
return false ;
0 commit comments