Closed gratipay-bot closed 7 years ago
There are only ~30 card holds. I might cancel manually in the Braintree dashboard instead of trying to script it in API.
Although, looking at fetch_card_holds
... it's a static method and if we pass it an empty list of participant_ids it should do what we want.
I think we can just do:
$ heroku run python
[...]
>>> from gratipay.billing.payday import Payday
>>> Payday.fetch_card_holds([])
[]
[gratipay] $ honcho run -e defaults.env,local.env env/bin/python < cancel-holds.py
pid-3003 thread-140737185432512 (MainThread) Fetching card holds.
[gratipay] $
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])
Sooo ...
$ heroku run python < cancel-holds.py
You okay with that, @rohitpaulk?
I don't see a side-effect to importing Payday
, and wireup.billing
also looks safe.
[gratipay] $ heroku run python < cancel-holds.py > cancel-holds.log
Running python on gratipay... up, run.5784 (Hobby)
^C[gratipay] $ cat cancel-holds.log
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from gratipay import wireup
wireup.billing(wireup.env())
print('Greetings, program!')
Python 2.7.11 (default, Oct 26 2016, 16:32:16)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> # -*- coding: utf-8 -*-
teralsom __future__ import absolute_import, division, print_function, unicode_li
>>>
>>> from gratipay import wireup
>>>
>>> wireup.billing(wireup.env())
>>>
>>> print('Greetings, program!')
Greetings, program!
>>> [gratipay] $
[gratipay] $ heroku run python -c "`cat greetings.py`"
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
print('Greetings, program!')" on ⬢ gratipay... up, run.8444 (Hobby)
Greetings, program!
[gratipay] $
Okay, getting ready to pull the trigger on:
[gratipay] $ heroku run python -c "`cat cancel-holds.py`" 2>&1 | tee cancel-holds.log
from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])
3 ...
2 ...
1 ...
0!
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... starting, run.4177 (Hobby)
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... connecting, run.4177 (Hobby)
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... up, run.4177 (Hobby)
pid-4 thread-139695064790784 (MainThread) Fetching card holds.
pid-4 thread-139695064790784 (MainThread) Canceled a $11.13 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.10 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $103.30 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.64 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $20.91 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $13.70 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $20.91 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.36 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.05 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.64 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.87 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.00 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.82 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $103.30 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.52 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $16.79 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.51 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.13 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $19.10 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.10 hold for [].
cancel-holds.log
appended to gratipay-274.log
in https://github.com/gratipay/logs/commit/aa24ac447d7ed8ac165531e881a9805586ca914f.
Still held in my bank account per bank's web interface. Will check back later on that.
We canceled one extra hold for 12.05 that must've been left over from ... last time? Or something? Otherwise the amounts all line up for the 31 we accidentally created.
Oh! Hold placement is multi-threaded so we could've created the 12.05 hold but not logged it.
Alright! Things to reticket:
Reticketed! Closing.
← Payday 273
Runbook
http://inside.gratipay.com/howto/run-payday
Checklist
Rotation