Skip to content

Instantly share code, notes, and snippets.

@miodeqqq
Created September 2, 2020 13:03
Show Gist options
  • Save miodeqqq/aaa87febda7368570c7b7c6443d8fb25 to your computer and use it in GitHub Desktop.
Save miodeqqq/aaa87febda7368570c7b7c6443d8fb25 to your computer and use it in GitHub Desktop.
Django & Stripe - create_connect_account.py
mcc_code, url = "1520", "https://www.softserveinc.com/"
response_ca = stripe.Account.create(
type="custom",
country="PL",
email=user2.email,
default_currency="pln",
business_type="individual",
settings={"payouts": {"schedule": {"interval": "manual", }}},
requested_capabilities=["card_payments", "transfers", ],
business_profile={"mcc": mcc_code, "url": url},
individual={
"first_name": user2.first_name,
"last_name": user2.last_name,
"email": user2.email,
"dob": {
"day": user2.profile.date_of_birth.day,
"month": user2.profile.date_of_birth.month,
"year": user2.profile.date_of_birth.year,
},
"phone": user2.profile.phone_number,
"address": {
"city": user2.city,
"postal_code": user2.profile.postal_code,
"country": "PL",
"line1": user2.profile.address,
},
},
)
user2.stripe_id = response_ca.stripe_id
user2.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment