createPlan = async (product) => {
    const stripePlans = await stripe.plans.list({ limit: 100 });
    let [stripePlan] = stripePlans.data.filter((stripePlan) => stripePlan.id === plan.id);

    if (stripePlan) {
      if (
        // check if plan is the same
        stripePlan.nickname === plan.nickname &&
        stripePlan.amount === plan.amount &&
        stripePlan.interval === plan.interval &&
        stripePlan.currency === plan.currency &&
        stripePlan.product === product.id
      ) {
        console.log(
          `Plan - OK -->  '${stripePlan.nickname}' with product id
          '${stripePlan.product}' has been already created before`
        );
      } else {
        // if plan was changed then delete existing stripe plan
        await stripe.plans.del(plan.id);
        stripePlan = await stripe.plans.create({ product: product.id, ...plan });
        console.log(`Plan - OK -->  '${stripePlan.nickname}' with product id '${stripePlan.product}' has been created`);
      }
    } else {
      stripePlan = await stripe.plans.create({ product: product.id, ...plan });
      console.log(`Plan - OK -->  '${stripePlan.nickname}' with product id '${stripePlan.product}' has been created`);
    }

    return stripePlan;
  }
Creates Stripe plan if it hasn't been already created or if parameters of plan were changed

@param product - Stripe product
@return {Promise<void>} - Stripe plan