Compare commits

...

4 Commits

Author SHA1 Message Date
adasauce 933a6787de
Merge branch 'static-cp-fix' into forefixed 5 years ago
adasauce e10bbf10cc
Use the configured currency during the cronjob 5 years ago
adasauce c95f972c04
Add CAD currency, for stripe usage later. 5 years ago
Adasauce a364bbe1d3
have Makefile `cp -r` the _static contents 5 years ago
  1. 2
      Makefile
  2. 4
      cronjob.py
  3. 3
      fosspay/currency.py

@ -14,7 +14,7 @@ _STATIC:=$(patsubst _static/%,static/%,$(wildcard _static/*))
static/%: _static/%
@mkdir -p static/
cp $< $@
cp -r $< $@
static/%.css: styles/%.css
@mkdir -p static/

@ -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")
)

@ -13,7 +13,8 @@ class Currency:
currencies = {
'usd' : Currency("$", "left"),
'eur' : Currency("", "right")
'eur' : Currency("", "right"),
'cad' : Currency("$", "left")
# ... More currencies can be added here
}

Loading…
Cancel
Save