Provider created subscription in PBA 5.4 using API method SubscriptionAdd_API. A customer or Provider on behalf of a customer placed upgrade (switch plan or plan period) or cancelation order.
PBA did not include refund into upgrade order for the previous Service Plan, only charge for the new plan was added. PBA also did not include refund into cancelation order.
The example of wrong plan switching order - only recurring fee for the new Service Plan is included into the order:
The example of correct order - refund for the previous plan is included along with the recurring fee for the new plan:
The refund calculation algorithm introduced in PBA 5.4 works incorrectly for subscriptions created through API.
The problem is fixed in PBA 5.4 Update 7, upgrade installation to this or later version.