Skip to content

Instantly share code, notes, and snippets.

@tspycher
Created February 22, 2016 18:38
Show Gist options
  • Save tspycher/ee0ef3655890d67d92bd to your computer and use it in GitHub Desktop.
Save tspycher/ee0ef3655890d67d92bd to your computer and use it in GitHub Desktop.
def externalPaymentAttributes():
return {
'country': 'CH',
'email': self.host_emails[0] if self.host_emails else None,
'business_name': self.name,
#'business_tax_id_provided': False,
'tos_acceptance': {
'date': int(time.time()),
'ip': "185.90.38.128",
'user_agent': 'Cathedra Backend'
},
"external_account": {
"account_number": self.detail.external_account_iban,
"object": "bank_account",
"country": self.detail.external_account_country,
"currency": self.detail.external_account_currency,
} if self.detail.external_account_iban else None,
"legal_entity": {
"address": {
"city": self.address.city,
"country": self.address.country,
"line1": "%s %s" % (self.address.street, self.address.houseNumber),
"postal_code": self.address.zip,
},
#"address_kana": {},
#"address_kanji": {},
#"personal_address": {},
#"personal_address_kana": {},
#"personal_address_kanji": {},
#"ssn_last_4_provided": False,
#"personal_id_number_provided": False,
#"verification": {},
"business_name": self.name,
"dob": {
"day": self.detail.legal_entity_dateofbirth.day if self.detail.legal_entity_dateofbirth else None,
"month": self.detail.legal_entity_dateofbirth.month if self.detail.legal_entity_dateofbirth else None,
"year": self.detail.legal_entity_dateofbirth.year if self.detail.legal_entity_dateofbirth else None
},
"first_name": self.detail.legal_entity_first_name,
"last_name": self.detail.legal_entity_last_name,
"type": "corporation",
}
}
account = stripe.Account.retrieve(obj.externalPaymentId)
account.update(externalPaymentAttributes())
account.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment