#NEWLINE# def sync_transfer( transfer , event = None ) : #NEWLINE# #INDENT# '\n    Syncronizes a transfer from the Stripe API\n\n    Args:\n        transfer: data from Stripe API representing transfer\n        event: the event associated with the transfer\n    ' #NEWLINE# defaults = { #NEWLINE# #INDENT# 'amount' : utils . convert_amount_for_db ( transfer [ 'amount' ] , transfer [ 'currency' ] ) , #NEWLINE# 'currency' : transfer [ 'currency' ] , #NEWLINE# 'status' : transfer [ 'status' ] , #NEWLINE# 'date' : utils . convert_tstamp ( transfer , 'date' ) , #NEWLINE# 'description' : transfer . get ( 'description' , '' ) , #NEWLINE# 'event' : event , #NEWLINE# #UNINDENT# } #NEWLINE# ( obj , created ) = models . Transfer . objects . get_or_create ( stripe_id = transfer [ 'id' ] , defaults = defaults ) #NEWLINE# if ( not created ) : #NEWLINE# #INDENT# obj . status = transfer [ 'status' ] #NEWLINE# obj . save ( )