-
-
Save theukedge/a5a6a65599a15482139ef24b32cfe5e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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