~singpolyma/sgx-jmp

sgx-jmp/lib/transaction.rb -rw-r--r-- 1.8 KiB
Command to Manually Add Money to Account

An admin can now add a transaction to an account without having to log
into the DB.

A few notes:
- The transaction ID allows a "%" in it which gets substituted with a
  unique value. This is so if you've got a transaction value already,
  like an Interac Transfer or something, you can just put it here.
  But if I'm making something up like "cash" I don't have to mash the
  keyboard just to get a good ID. I can just use "cash_%" and be content
  that I'll get a good value
- The notes have a few prefilled values, which is just there for
  convenience and consistency.
  They're an open list, though, for manual things. Except on clients
  that don't support open lists...
- There's an option to notify the user. I haven't built that in this
  commit and will come later. This is so that under normal operation we
  don't have to message from support and tell them "hey, we've got your
  money", and even better we don't have to tell them "hey, we've got
  your money, you may want to go talk to the bot to activate".

  But if support is already talking to them, we can disable it and tell
  them things in a more organic way.

  Like I said, I haven't built that in this commit, though.

So, this is a start, at least.
Transaction Delete and Existance

Now that Transaction acts as a kind of repo, there's two other methods
I'm going to want for the future.
Split CreditCardSale from Transaction

This is a refactor that involves pulling the Credit Card stuff (meaning
braintree) out of the Transaction stuff. This makes Transaction a more
generic implementation of our Transaction table.

This commit should maintain the status quo, though. The places that used
to call Transaction.sale now call CreditCardSale.create, and that got a
little easier because we now do the `.insert` inside the create, because
previously all the callsites just got the transaction out and then
inserted anyway.

So they got a little bit simpler, but the main value of this is that now
we can insert other kinds of transactions and not just credit card
transactions!
Amount needs to be a number to check it
Merge branch 'limit-credit-card-amount'

* limit-credit-card-amount:
  Limit size of credit card transaction by trust level
Limit size of credit card transaction by trust level
Merge branch 'limit-top-up-take-2'

* limit-top-up-take-2:
  Only one credit card transaction per customer per day
Only one credit card transaction per customer per day
Revert "Merge branch 'limit-top-up-freq'"

This reverts commit 7a28753d7df5d7d6f5f890d302634b1bdbd25f73, reversing
changes made to e4ec9b8eb368ed0997887ebd99f8c79982640d20.
Merge branch 'limit-top-up-freq'

* limit-top-up-freq:
  Only allow one credit card transaction per customer per day
Only allow one credit card transaction per customer per day
Revert "Merge branch 'three_d_secure'"

This reverts commit 36f441c031a5318385ec78d7d2e021a8e2fab186, reversing
changes made to 3b0ae3c9387d3be41b30bd6dd4552ff0a841d8ed.
Merge branch 'three_d_secure'

* three_d_secure:
  Send 3DS id when making a transaction
Send 3DS id when making a transaction
Merge branch 'credit-card-blacklist'

* credit-card-blacklist:
  Credit card blacklist
Credit card blacklist

Any card on the list is just treated as though it is not present, preventing it
from being used.
Merge branch 'insert-settled-after'

* insert-settled-after:
  Credit card transactions settle after 90 days, bills instantly
Credit card transactions settle after 90 days, bills instantly
Declines should be an Int

Previously this retured a string and everywhere that used it had to
convert it into an it, or handle it if it's nil.

That's dumb.
Now it's always an int, and `nil.to_i` is 0 anyway so I don't have to
check that either.
Merge branch 'tx-list'

* tx-list:
  Admin Command Menu + Admin Financial View
  Transactions List
  Customer Financials
  Telephone Link
Next