Stopping pricing plans from stacking

Hi all,
On my site I have set up pricing plans and want to make it so that users can only have one at a time. I don’t think that there is a native feature for this so I tried to achieve it with code, here is where I’m at.

export function myChangeStartDateFunction() {
orders.listCurrentMemberOrders({orderStatuses:[“ACTIVE”]}).then((order) => {
checkout.changeStartDate(1, order[0].endDate);
});
}

This code runs whenever the checkout window is opened and will change the start date of the plan the user is ordering to the end date of their current plan. The issue is that I have recurring payments set up which means the endDate doesn’t actually work. I need it so that the plan they are about to buy will only become active once their other plans are finished. Is there any other way to make this kind of feature? Would I have to do something like pausing the plan until the other ends? What would be the best way to do this

I decided to look into the pausing idea and have this code:

export function wixPricingPlans_onOrderPurchased(event) {
const memberId = event.data.order.buyer.memberId;
orders.listOrders({buyerIds:[memberId],orderStatuses:[“ACTIVE”]})
.then((order) => {
if (order.length > 0) {
let orderId = event.metadata.entityId.toString();
try {
orders.pauseOrder(orderId);

    } catch (err) { 
      console.log(err); 
    } 
  } 

});
}

Everything in this code seems to work fine expect the pausing. I have tried suppressAuth:true to see if that was the issue though it didn’t change anything. I would appreciate some ideas.