* activate-with-balance:
If customer already has enough balance, just bill them and finish
New BillPay registration step
Save plan to DB as soon as it is selected
Move credit_to lookup into relevant class
Stephen Paul Weber
created
8291b15
If customer already has enough balance, just bill them and finish
Customer will appear as instantly expired (having been active for 1 second in
the immediate past).
This can replace the pending_plan key for BTC activations. It also serves as a
record for mail-in activation of what plan they had selected.
Once the account is really activated the tiny row is removed.
Implements the full logic of the billing_monthly_cronjob for one customer by
reusing code that has been written more robustly in sgx-jmp for some time. This
will allow the cronjob to just execute this command once a day for each expiring
customer to get all the correct billing behaviours.
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.
In my testing the natural order just happened to be the date order
because I had so little data.
But in the real world we should probably be more explicit!
Previously cancels would be treated as an error, but then would be
caught so that they could respond with receipt of the cancel later.
But, we weren't setting @iq in these cases, because it was an error, so
we would actually respond to the wrong stanza; specifically the one
before the cancel.
This was bad and wrong and led to the bot sitting there waiting for the
cancel before moving on with its life.
Not only is it allowed, but actually there's a ton of empty notes. Every
monthly account activation is missing a note, so practically every user
that has transactions will have empty notes.
I've added a new command to show financial information about the user.
But more importantly I've added an infinite admin subsystem which allows
me to go into a user and then run multiple commands on them.
For now it's just these two info commands, but in the future I'd like to
add mutative commands here.
Finally, since I sometimes look up multiple users in a pretty short
timeframe I made the menu open and if I put something into the list that
doesn't parse as one of the actions it instead switches the current user
so I don't have to do "cancel", "customer", and then put the next one
in.
I can just have the session open and put stuff in as needed.
I've pulled out information about payment methods and bitcoin into its
own thing. It's kind of a repository, except that it only exposes
fetchers and doesn't load anything generally.
There's also a few new methods here that aren't used yet, but will be
shortly.
Sometimes I need to go there to look something up or change a setting,
and every time I do I have to navigate through the UI to a number I
already know.
This should make that faster.
5fe4706
Add state search - for granularity & jmp-register
Click to expand commit body
Note that this is not quite complete yet, since we need to pull in the
STATE_MAP stuff used elsewhere to make it work properly. But it will
at least work for every state/province/territory that is not Quebec
for now, which is way better than nothing. Quebec users will get the
same fallbacks they had before.
Denver Gingerich
created
46147c4
Do not log error when hangup/voicemail a call that is already gone
492360c
Error from SGX should not result in an unregistered customer
Click to expand commit body
If the SGX fetch fails, this is a problem. Even in the original case this was
written for (registration) we have seen strange issues that can come up when the
code assumes that an SGX error means they are unregistered. They may or may not
be unregistered, and we simply don't know. So we should let the error bubble
through and be handled (if possible) upstream.
Stephen Paul Weber
created
2356e70
Use Transfer because Forward doesn't work once answered