Skip to content
Merged
Show file tree
Hide file tree
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
MSD Billing: Fix atomic plan revert confirmation checkbox
  • Loading branch information
chrismccluskey committed Mar 20, 2026
commit 4c6e3c5d2cabe887f88cbb71e24ea4bbbb6f15ec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface CancellationMainContentProps {
onCancelConfirmationStateChange: ( newState: Partial< CancelPurchaseState > ) => void;
onDomainConfirmationChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingAtomicPlanRevert: ( checked: boolean ) => void;
onKeepSubscriptionClick: () => void;
onCancelClick?: () => void;
}
Expand All @@ -56,6 +57,7 @@ export default function CancellationMainContent( {
onCancelConfirmationStateChange,
onDomainConfirmationChange,
onCustomerConfirmedUnderstandingChange,
onCustomerConfirmedUnderstandingAtomicPlanRevert,
onKeepSubscriptionClick,
onCancelClick,
}: CancellationMainContentProps ) {
Expand Down Expand Up @@ -158,6 +160,9 @@ export default function CancellationMainContent( {
state={ state }
onDomainConfirmationChange={ onDomainConfirmationChange }
onCustomerConfirmedUnderstandingChange={ onCustomerConfirmedUnderstandingChange }
onCustomerConfirmedUnderstandingAtomicPlanRevert={
onCustomerConfirmedUnderstandingAtomicPlanRevert
}
onKeepSubscriptionClick={ onKeepSubscriptionClick }
onCancelClick={ onCancelClick }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface CancellationPreSurveyContentProps {
onCancelConfirmationStateChange: ( newState: Partial< CancelPurchaseState > ) => void;
onDomainConfirmationChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingAtomicPlanRevert: ( checked: boolean ) => void;
onKeepSubscriptionClick: () => void;
onCancellationComplete: () => void;
onCancellationStart: () => void;
Expand All @@ -35,6 +36,7 @@ export default function CancellationPreSurveyContent( {
onCancelConfirmationStateChange,
onDomainConfirmationChange,
onCustomerConfirmedUnderstandingChange,
onCustomerConfirmedUnderstandingAtomicPlanRevert,
onKeepSubscriptionClick,
onCancellationComplete,
onCancellationStart,
Expand Down Expand Up @@ -62,6 +64,9 @@ export default function CancellationPreSurveyContent( {
onCancelConfirmationStateChange={ onCancelConfirmationStateChange }
onDomainConfirmationChange={ onDomainConfirmationChange }
onCustomerConfirmedUnderstandingChange={ onCustomerConfirmedUnderstandingChange }
onCustomerConfirmedUnderstandingAtomicPlanRevert={
onCustomerConfirmedUnderstandingAtomicPlanRevert
}
onKeepSubscriptionClick={ onKeepSubscriptionClick }
onCancelClick={
shouldHandleMarketplaceSubscriptions() ? showMarketplaceDialog : onCancellationStart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface ConfirmCheckboxProps {
state: CancelPurchaseState;
onDomainConfirmationChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingAtomicPlanRevert: ( checked: boolean ) => void;
}

export default function ConfirmCheckbox( {
Expand All @@ -25,6 +26,7 @@ export default function ConfirmCheckbox( {
state,
onDomainConfirmationChange,
onCustomerConfirmedUnderstandingChange,
onCustomerConfirmedUnderstandingAtomicPlanRevert,
}: ConfirmCheckboxProps ) {
const isDomainRegistrationPurchase = purchase && purchase.is_domain_registration;

Expand Down Expand Up @@ -76,6 +78,7 @@ export default function ConfirmCheckbox( {
onChange={ ( checked ) => {
if ( atomicTransfer?.created_at ) {
onCustomerConfirmedUnderstandingChange( checked );
onCustomerConfirmedUnderstandingAtomicPlanRevert( checked );
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm explicitly calling both functions here, but I could just as easily only call the atomic plan revert function in the if ( atomicTransfer?.created_at ) block and remove the return. My concern is that doing so will rely on that return not being present when it might normally look like it should be given how the functions are named.

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,10 @@ export default function CancelPurchase() {
setState( ( state ) => ( { ...state, customerConfirmedUnderstanding: checked } ) );
};

const onCustomerConfirmedUnderstandingAtomicPlanRevert = ( checked: boolean ) => {
setState( ( state ) => ( { ...state, atomicRevertConfirmed: checked } ) );
};

if ( isHundredYearDomain ) {
redirectBack();
return null;
Expand Down Expand Up @@ -1508,6 +1512,9 @@ export default function CancelPurchase() {
onCancelConfirmationStateChange={ onCancelConfirmationStateChange }
onDomainConfirmationChange={ onDomainConfirmationChange }
onCustomerConfirmedUnderstandingChange={ onCustomerConfirmedUnderstandingChange }
onCustomerConfirmedUnderstandingAtomicPlanRevert={
onCustomerConfirmedUnderstandingAtomicPlanRevert
}
onKeepSubscriptionClick={ onKeepSubscriptionClick }
onCancellationComplete={ onCancellationComplete }
onCancellationStart={ onCancellationStart }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface PlanProductRevertContentProps {
state: CancelPurchaseState;
onDomainConfirmationChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingChange: ( checked: boolean ) => void;
onCustomerConfirmedUnderstandingAtomicPlanRevert: ( checked: boolean ) => void;
onKeepSubscriptionClick: () => void;
onCancelClick?: () => void;
}
Expand All @@ -27,6 +28,7 @@ export default function PlanProductRevertContent( {
state,
onDomainConfirmationChange,
onCustomerConfirmedUnderstandingChange,
onCustomerConfirmedUnderstandingAtomicPlanRevert,
onKeepSubscriptionClick,
onCancelClick,
}: PlanProductRevertContentProps ) {
Expand All @@ -50,6 +52,9 @@ export default function PlanProductRevertContent( {
state={ state }
onDomainConfirmationChange={ onDomainConfirmationChange }
onCustomerConfirmedUnderstandingChange={ onCustomerConfirmedUnderstandingChange }
onCustomerConfirmedUnderstandingAtomicPlanRevert={
onCustomerConfirmedUnderstandingAtomicPlanRevert
}
/>
) }

Expand Down
Loading