|
@@ 224-239 (lines=16) @@
|
| 221 |
|
|
| 222 |
|
|
| 223 |
|
# Call this when a credit card transaction deposits money into an account |
| 224 |
|
@top_debtor_wrapper |
| 225 |
|
def cc_deposit(user, account, amount, txn_id, last4): |
| 226 |
|
assert(amount > 0.0) |
| 227 |
|
assert(hasattr(user, "id")) |
| 228 |
|
|
| 229 |
|
prev = user.balance |
| 230 |
|
e = event.Deposit(user) |
| 231 |
|
DBSession.add(e) |
| 232 |
|
DBSession.flush() |
| 233 |
|
t = transaction.CCDeposit(e, account, amount, txn_id, last4) |
| 234 |
|
DBSession.add(t) |
| 235 |
|
return dict(prev=prev, |
| 236 |
|
new=user.balance, |
| 237 |
|
amount=amount, |
| 238 |
|
transaction=t, |
| 239 |
|
event=e) |
| 240 |
|
|
| 241 |
|
|
| 242 |
|
# Call this to deposit bitcoins to the user account |
|
@@ 205-220 (lines=16) @@
|
| 202 |
|
|
| 203 |
|
# Call this when a user puts money in the dropbox and needs to deposit it |
| 204 |
|
# to their account |
| 205 |
|
@top_debtor_wrapper |
| 206 |
|
def deposit(user, account, amount): |
| 207 |
|
assert(amount > 0.0) |
| 208 |
|
assert(hasattr(user, "id")) |
| 209 |
|
|
| 210 |
|
prev = user.balance |
| 211 |
|
e = event.Deposit(user) |
| 212 |
|
DBSession.add(e) |
| 213 |
|
DBSession.flush() |
| 214 |
|
t = transaction.CashDeposit(e, account, amount) |
| 215 |
|
DBSession.add(t) |
| 216 |
|
return dict(prev=prev, |
| 217 |
|
new=user.balance, |
| 218 |
|
amount=amount, |
| 219 |
|
transaction=t, |
| 220 |
|
event=e) |
| 221 |
|
|
| 222 |
|
|
| 223 |
|
# Call this when a credit card transaction deposits money into an account |