From e6ba79c8f53186634dc20d0056108c64882668d7 Mon Sep 17 00:00:00 2001 From: adasauce Date: Wed, 22 Apr 2020 16:50:26 -0300 Subject: [PATCH] Use the configured currency during the cronjob currently hardcoded to USD, if you have this configured to something else, you will charge in USD during subscriptions even if you have a different currency set in config.ini. this makes it consistent with the behaviour in fosspay/blueprints/html.py --- cronjob.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cronjob.py b/cronjob.py index 24879b0..6032f59 100755 --- a/cronjob.py +++ b/cronjob.py @@ -12,6 +12,8 @@ import subprocess stripe.api_key = _cfg("stripe-secret") +currency = _cfg("currency") + print("Processing monthly donations at " + str(datetime.utcnow())) donations = Donation.query \ @@ -29,7 +31,7 @@ for donation in donations: try: charge = stripe.Charge.create( amount=donation.amount, - currency="usd", + currency=currency, customer=user.stripe_customer, description="Donation to " + _cfg("your-name") ) -- 2.45.2