~singpolyma/jmp-pay

ref: e0ba65ce4f92b8f692969d8fe9c68ea49a024d50 jmp-pay/bin/process_pending_btc_transactions -rwxr-xr-x 6.4 KiB
Send notifications using Cheogram whispers

This way they don't need an assigned tel to work.
Include BTC amount and currency in notification
Don't send malformed to JID when customer has no tel yet
Ping healthchecks for each run
Activate pending plan for customer when they pay enough BTC

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.
Add bonus whenever a larger BTC deposit comes in
Notify customer on sucessful BTC deposit

Since BTC transactions can take some time, let the user know when it is done and
how much credit they got for their money.
Cronjob to check pending BTC transactions

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.