Commit log

8db7170 Wait until fully disconnected before EM.stop

Stephen Paul Weber created

7756538 Transaction id must be unique

Stephen Paul Weber created

2512322 format number

Stephen Paul Weber created

47eec8e typo

Stephen Paul Weber created

b243062 Include BTC addresses in notification, if there are any

Stephen Paul Weber created

ceae65b If a user has no balance, then their balance is 0

Stephen Paul Weber created

d2d3d3c Only notify expired users once a week

Stephen Paul Weber created

e6c4d2c Fix Dhall signature

Click to expand commit body
The config got updated, but the signature was missed.

Stephen Paul Weber created

b99296b Fix intermittent notification non-delivery

Click to expand commit body
We need to wait until all EventMachine items in flight are complete before we
allow the process to terminate or some of them might not happen.  So when the
process wants to exit, wait until the EM thread is done.  Use next_tick to make
sure our stop command only happens when the EM queue is next clear.

Stephen Paul Weber created

7b86f94 update schemas to include hotfix from prod and sqitch tag for prod

Stephen Paul Weber created

b4988c1 Update schema and INSERT to plan_log using new range type

Click to expand commit body
plan_log has been updated to use a range type, so our INSERTs need to be
updated as well.

Stephen Paul Weber created

1acc55b Allow new users to opt-in to balance auto-top-up

Click to expand commit body
We don't have auto top up built yet, but once we do they will be able to start
getting it right away instead of needing to manually turn it on later.

Stephen Paul Weber created

0846f6d hotfix from prod, avoid crash on old session

Stephen Paul Weber created

69e33bf docs say there is a better error in UI for this case already

Stephen Paul Weber created

cd1aa36 include sentry when there is a dsn

Stephen Paul Weber created

2f06095 empty array is not falsy

Stephen Paul Weber created

b82226b Always a bonus, maybe of 0

Stephen Paul Weber created

1f738ae Does not take both those arguments anymore

Stephen Paul Weber created

c1aab03 Do not try query when values is empty

Click to expand commit body
If there are no values to query with, then the SQL will be invalid and throw an
error, so just return empty for that case.

Stephen Paul Weber created

431d153 typo

Stephen Paul Weber created

cc6b975 No crash when there are no new transactions to process

Click to expand commit body
Found during initial migration, when a request comes in and it turns out there
are no new transactions, we should not try to set nothing to Redis since that
will throw an exception.

Stephen Paul Weber created

810b55c Block users who get too many card declines

Click to expand commit body
If a customer has > 2 card declines in 24 hours or an ip has > 4, then treat all
attempts as declines without looking as an anti-fraud measure.

Stephen Paul Weber created

9a50e2d Prevent double-activate

Click to expand commit body
We're seeing trouble in production where users activate more than once, which
results in suboptimal DB contents.  If they're already active, just redirect
them back to complete registration.

Stephen Paul Weber created

89cc541 Log plan name on exception to sentry

Stephen Paul Weber created

59cb1bd add sentry

Stephen Paul Weber created

737b8ac Allow activating an account via credit card on web

Click to expand commit body
This is designed to work with current jmp-register flows pending new-register
existing.  Link a user to https://pay.jmp.chat/<jid>/activate?return_to=... and
they can choose to buy 5 months of service in either USD or CAD on a supported
credit card.  The card will be vaulted onto their newly-minted customer_id and
the amount immediately billed. No account balance will be set or used, but
rather a plan_log row created starting now and expiring in 5 months.

Stephen Paul Weber created

4b6de2b Higher XMPP connect timeout

Click to expand commit body
Because sometimes the box is under high load.

Stephen Paul Weber created

dbfef44 better healthcheck log

Stephen Paul Weber created

42ba844 Don't notify when re-processing transaction already in DB

Stephen Paul Weber created

a529fc2 Initial test suite and helpers

Stephen Paul Weber created

fc43c79 Send complete, useful approval message on account activation

Click to expand commit body
With link pointing to jmp-register until new-signup happens.

Stephen Paul Weber created

2872a5f Switch to stepwise bonus factor breakpoints

Click to expand commit body
The max bonus is a bit smaller than the previous formula, but this one is
perhaps more "explainable" and still matches current pricing.  The breakpoints
are done in native currency (not currency-converted) which means that CAD users
get the next breakpoint "sooner" -- this is a small advantage to CAD users, who
we want to encourage anyway.

Stephen Paul Weber created

e0ba65c Send notifications using Cheogram whispers

Click to expand commit body
This way they don't need an assigned tel to work.

Stephen Paul Weber created

77715a3 Include BTC amount and currency in notification

Stephen Paul Weber created

c09aa94 Don't send malformed to JID when customer has no tel yet

Stephen Paul Weber created

0a89e15 Ping healthchecks for each run

Stephen Paul Weber created

3589749 Activate pending plan for customer when they pay enough BTC

Click to expand commit body
This is effectively the "BTC auto-accept" new way.  If they send enough to
activate (as set by activation_amount in config) and they have a pending plan in
redis and no plan in the db, then we buy them that plan.

We can't use the normal way to notify the user, because they likely haven't
bought a phone number yet.  Eventually we will be able to tell new-signup about
this and have it inserted into the flow there, I think? Not sure what we want to
do transitionally.

Stephen Paul Weber created

e897334 Add bonus whenever a larger BTC deposit comes in

Stephen Paul Weber created

2c77b1d Notify customer on sucessful BTC deposit

Click to expand commit body
Since BTC transactions can take some time, let the user know when it is done and
how much credit they got for their money.

Stephen Paul Weber created

7c438f8 Notify customer when renewal fails due to low balance

Click to expand commit body
This is done by sending from a configured JID to <tel>@cheogram.com in order to
have them receive a message from support.

Stephen Paul Weber created

37b09a4 Create initial monthly billing cronjob

Click to expand commit body
Renews all expired plans where there is enough balance to do so.

Sets expires_at on all renewed plans to one month from today, so even if they
were very expired they are up to date the moment they pay.

Stephen Paul Weber created

ba4d587 Cronjob to check pending BTC transactions

Click to expand commit body
When they become confirmed, insert them into the transactions table.
We can never double-insert because of the PRIMARY KEY on transaction_id, so the
script is always safe to run even if something ends up in redis twice.

Stephen Paul Weber created

6cd9f94 Endpoint that pushes all unknown transactions into Redis

Click to expand commit body
The intent is to use `electrum notify <address> <app>/electrum_noify?address=&customer_id=`

The app asks electrum for all transactions on that address, and then checks
which ones we *don't* already have recorded in the transactions table.  These
are pushed into Redis to be picked up by a to-be-written job that will write
them to the transactions table after 3 confirmations.

Stephen Paul Weber created

56244eb Save bidirectional association for customer_id in redis

Stephen Paul Weber created

e76129e Hide loading spinner on error so the error state can show

Stephen Paul Weber created

9aa9b9a In production, require customer_id be passed also.

Click to expand commit body
As a security measure, so people can't modify the cards on arbitrary JIDs.

Stephen Paul Weber created

68e61f0 ci

Stephen Paul Weber created

f2b4acb Add magic comment

Stephen Paul Weber created

143c609 Going to use this as a customer id for the whole billing system

Click to expand commit body
So it's not really braintree specific, even if we make it match the one there.

Stephen Paul Weber created

0e9a56e fix typo

Stephen Paul Weber created