Skip to content

Instantly share code, notes, and snippets.

@theukedge

theukedge/zap.py Secret

Created April 26, 2016 14:55
Show Gist options
  • Save theukedge/a5a6a65599a15482139ef24b32cfe5e9 to your computer and use it in GitHub Desktop.
Save theukedge/a5a6a65599a15482139ef24b32cfe5e9 to your computer and use it in GitHub Desktop.
from datetime import datetime
stripe_date = datetime.fromtimestamp( int( input['date'] ) )
transfer = datetime.fromtimestamp( int( input['date'] ) + 172800 )
if ' ' in input['full_name']:
first, last = input['full_name'].split(' ', 1)
else:
first, last = input['full_name'], None # fallback
return {
'amount': "%.2f" % round( float(input['amount']) / 100, 2),
'fee': "%.2f" % round( float(input['fee']) / 100, 2),
'net': "%.2f" % round( float(input['net']) / 100, 2),
'transaction_date': stripe_date.strftime('%m/%d/%y'),
'transfer_date': transfer.strftime('%m/%d/%y'),
'first_name': first,
'last_name': last
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment