mirror of https://git.sr.ht/~sircmpwn/fosspay
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
464 B
20 lines
464 B
#!/usr/bin/env python3
|
|
from fosspay.database import db
|
|
from fosspay.objects import Invoice
|
|
from fosspay.config import _cfg
|
|
import sys
|
|
|
|
if len(sys.argv) != 3:
|
|
print(f"Usage: {sys.argv[0]} <amount in cents> <comment>")
|
|
sys.exit(1)
|
|
|
|
amount = int(sys.argv[1])
|
|
comment = sys.argv[2]
|
|
|
|
invoice = Invoice()
|
|
invoice.amount = amount
|
|
invoice.comment = comment
|
|
db.add(invoice)
|
|
db.commit()
|
|
|
|
print(f"{_cfg('protocol')}://{_cfg('domain')}/invoice/{invoice.external_id}")
|
|
|