Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
isAkismetProduct,
isPartnerPurchase,
willAtomicSiteRevertAfterPurchaseDeactivation,
isOneTimePurchase,
} from '../../../utils/purchase';
import CancelHeaderTitle from './cancel-header-title';
import CancelPurchaseForm from './cancel-purchase-form';
Expand Down Expand Up @@ -1040,7 +1041,7 @@ export default function CancelPurchase() {
! purchase.is_cancelable &&
! purchase.is_removable
) {
if ( ! createdErrorNoticeForRedirect.current ) {
if ( purchase.subscription_status !== 'active' && ! createdErrorNoticeForRedirect.current ) {
createErrorNotice(
__(
'This purchase has already been removed. Please contact support if you believe this to be in error.'
Expand All @@ -1049,6 +1050,28 @@ export default function CancelPurchase() {
);
createdErrorNoticeForRedirect.current = true;
}
if (
isOneTimePurchase( purchase ) &&
! purchase.is_refundable &&
! createdErrorNoticeForRedirect.current
) {
createErrorNotice(
__(
'This one time purchase cannot be cancelled. Please contact support if you need assistance.'
),
{ type: 'snackbar' }
);
createdErrorNoticeForRedirect.current = true;
}
if ( ! createdErrorNoticeForRedirect.current ) {
createErrorNotice(
__(
'This product cannot be cancelled or removed. Please contact support if you need assistance.'
),
{ type: 'snackbar' }
);
createdErrorNoticeForRedirect.current = true;
}
return false;
}

Expand Down