Skip to content

Commit e3b2177

Browse files
committed
Fix issue buying metered services without sub
1 parent 1396cb4 commit e3b2177

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,6 +3281,13 @@ export class Message {
32813281
}
32823282
if (metered) delete item.quantity;
32833283
}
3284+
} else {
3285+
for (var i = msg.subscription_items.length - 1; i >= 0; i--) {
3286+
var item = msg.subscription_items[i];
3287+
var _price = await this.Stripe<stripe_price>("GET", "prices", item.price, payload, customer.stripeid);
3288+
var metered = (_price.recurring && _price.recurring.usage_type == "metered");
3289+
if (metered) delete item.quantity;
3290+
}
32843291
}
32853292
payload.subscription_items = msg.subscription_items;
32863293
}

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.47",
3+
"version": "1.3.48",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.47
1+
1.3.48

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.47",
3+
"version": "1.3.48",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)