Skip to content

Commit 11e134b

Browse files
committed
add default price along with all prices
1 parent 5a78462 commit 11e134b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

stripe_python/util.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ def get_products( stripeApiKEY, outputFile='products.json'):
1818
dict['Name' ] = product['name']
1919
dict['Description' ] = product['description']
2020
dict['Images' ] = product['images']
21-
dict['Price' ] = product["default_price"]["unit_amount"]/100
21+
dict['Default Price' ] = product["default_price"]["unit_amount"]/100
22+
all_prices = stripe.Price.list(product=product["id"]).data
23+
pricedict = {}
24+
25+
for price in all_prices:
26+
pricedict[price["id"]] = price["unit_amount"] / 100
27+
28+
dict['Prices'] = pricedict
2229
productdict.append(dict)
2330

2431
with open(outputFile, "w") as outfile:

0 commit comments

Comments
 (0)