FlowFuse / FlowFuse/flowfuse

Support changing active price_id for devices

Open
#1,873 0 comments 0 reactions 0 assignees View on GitHub
task
Dominant language
JavaScript
Stars
400
Forks
89
Avg merge
1d 20h
Merged PRs (30d)
149

Description

### Description

We want to apply a new stripe price_id for the device product in FF Cloud.

Here is an assessment of the *current* behaviour if the price_id is changed in `flowforge.yml`:

1. For a team that has never had any devices, when they add a new device it will use the new `price_id`
2. For a team that has had devices at some point, any adding/removing devices will continue to apply at the old `price_id`

This is because the code that updates the subscription for a team looks for the Device item by `product_id`. If it doesn't find one (case 1 above), it generates a new billing item using `price_id`.
If it does find the Device item, it just updates the quantity entry without doing any validation the `price_id` is correct.

The fix will be, in case 2, to validate if the `price_id` matches what is expected. If it is not, then we remove that item and re-add with the new `price_id`.

### Epic/Story

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.