payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / money.sig
CommitLineData
208e2cbc
AC
1signature MONEY =
2sig
3 type transaction = {id :int, descr : string, amount : real, d : string, stamp : Init.C.timestamp}
4
5 val addTransaction : string * real * string -> int
6 val lookupTransaction : int -> transaction
7 val modTransaction : transaction -> unit
8 val deleteTransaction : int -> unit
9 val listTransactions : unit -> transaction list
10 val listTransactionsLimit : int -> transaction list
11 val listUserTransactions : int -> (real * transaction) list
12 val listUserTransactionsLimit : int * int -> (real * transaction) list
13 (* Returns list of (your part, overall) pairs *)
14 val listUsers : int -> (bool * Init.user) list
15 (* List users and indicate whether they participated in a transaction *)
16
f8b39e09
CE
17 type stripePayment = {charge_id : string, webuser_id : int, card_name : string, paid_on : string, gross_cents : int, fee_cents : int, net : real}
18
19 val listUserPendingStripePayments : int -> stripePayment list
20 val listAllPendingStripePayments : unit -> stripePayment list
21 val lookupStripePayment : string -> stripePayment
22 val applyStripePayment : stripePayment -> int
23
e84acecc
AC
24 val lookupHostingUsage : int -> string option
25
208e2cbc
AC
26 type charge = {trn : int, usr : int, amount : real}
27
28 val addCharge : charge -> unit
29 val listCharges : int -> charge list
30 val listChargesWithNames : int -> (string * charge) list
31
32 val clearCharges : int -> unit
f49e1088 33 val applyCharges : int -> unit
208e2cbc
AC
34
35 val addEvenCharges : int * int list -> unit
36
37 type hosting = {trn : int, cutoff : int, cost : real, usage : string}
38 val addHostingCharges : hosting -> unit
2d795343
AC
39
40 val equalizeBalances : unit -> unit
aaa50197
AC
41
42 val costBase : real -> real
1b566e48
AC
43
44 val delinquentPledgers : unit -> { id : int, name : string, shares : int, balance : real } list
45 val resetPledges : int list -> unit
eafe3d52 46
27e65914 47 val freezeworthyPledgers : unit -> { id : int, name : string, balance : real, joinedThisMonth : bool } list
950a4fad 48 val bootworthyPledgers : unit -> { id : int, name : string, balance : real, joinedThisMonth : bool } list
5c705bcb
AC
49
50 val billDues : {descr : string, base : real, date : string} -> unit
e84acecc 51end