How to properly get upcoming invoice (bill size) which I am going to pay when upgrading/downgrading subscriptions ? So it will take into account applied coupons, current balance/credits (after downgrade) and etc.
Tried like this:
\Stripe\Invoice::upcoming([
"customer" => $user->stripe_id,
"subscription" => 'sub_XXXXXXXXXXX', // current user subscription (monthly)
"subscription_prorate" => true,
"subscription_items" => [
["plan" => "plan_XXXXXXXXXXX"] // plan for upgrade (annually)
]
]);
But I am getting "Stripe\Error\InvalidRequest: Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field."
I understand that I'm getting that wrong, so please tell me how this should be done ?