mirror of
https://github.com/tildeclub/fosspay.git
synced 2026-01-24 11:10:18 +00:00
Source incoming :)
This commit is contained in:
20
invoice
Executable file
20
invoice
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/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}")
|
||||
Reference in New Issue
Block a user