~singpolyma/jmp-pay

ref: 68ed9c34b0d4a2eaa0e49def372deabe4eb55daf jmp-pay/lib d---------
Run billing 3 at a time

All at once kills the box
Merge branch 'bill-via-sgx-jmp'

* bill-via-sgx-jmp:
  Billing monthly cronjob using sgx-jmp
Billing monthly cronjob using sgx-jmp

Just get the list of expired customers and tell sgx-jmp about each of them, wait
until all return or one errors and log result.
Merge branch 'three_d'

* three_d:
  3D Secure Valuting
3D Secure Valuting
Check for low balance when setting auto top up

People expect to be able to set their auto top up setting in response to a low
balance alert, and have this solve the problem instantly.  This change resets
the lock that prevents sgx-jmp from acting on a low_balance notification, and
then asks the database to check if the balance is low and issue a notify if
relevant, which would then result in sgx-jmp acting and charging their card at
the newly-configured level.
Factor out AutoTopUpRepo and add tests
Removed web activation form

No longer used for either registrations or as a hack for payments, everything
handled by ad-hoc commands now and nothing links here any longer.
Merge branch 'do-not-bill-unregistered'

* do-not-bill-unregistered:
  Query sgx-jmp for every expired user
  Show backtrace and bail out hard on panic
Merge branch 'rubocop'

* rubocop:
  Update rubocop
Query sgx-jmp for every expired user

If they have no assigned tel, do not bill them or notify them.
Show backtrace and bail out hard on panic
Update rubocop

And use settings from sgx-jmp
Exit after an error in EM
Do not wait to exit until after we are ready
Script to create Redis key of BTC addresses available to the app
Copy in account activation logic from sgx-jmp

This is largely duplicated code, but the whole web-activation path should go
away soon.  This fixes web activation to produce the data we actually expect
instead of the hack previously produced.  Instead of an account activation for 5
months, we insert 5 months of balance and then bill for only one month as is reasonable.
Do not hang forever if shutdown fails
Various Electrum Checks and Fixes

There were some issues with Electrum, and we lost a bit of confidence,
so I built these to help with that.

bin/check_electrum_wallet_completeness
- This one is meant to be run in cron. It checks for addresses we've
  given a user that Electrum doesn't know we have. It just prints out,
  so we get an email and can go look.
  The purpose of this is to know before our users that we're missing
  something.

bin/detect_duplicate_addrs
- This one is meant to be run in cron. It looks through the addresses
  that users has have been given to make sure the same address hasn't
  been given out to more than one person.
  It just prints out the issues, so we'll be notified and can take a
  look

bin/correct_duplicate_addrs
- This is one potential solution that can be run in response to
  duplicate addresses.
  Since I'm expecting an email from bin/detect_duplicate_addrs, this
  takes as input the text that was sent to us.
  It goes through each address and re-assigns it away from all users,
  parking the addresses on the support account so we still get notified
  when people send money, etc
  Because it takes output as input, they could be piped together in
  theory, but I never tested that because I assume some investigation
  would be warranted

bin/reassert_electrum_notification
- This script goes through every bitcoin address that's been given to a
  customer and makes sure that electrum knows to tell us about changes
  to that address
Wait until fully disconnected before EM.stop
Next