Stripe Connect: Fix account name retrieval (#2857)

This commit is contained in:
Martin Gross
2022-10-19 17:55:34 +02:00
committed by GitHub
parent a29d69d8f7
commit e16fd61bec

View File

@@ -165,9 +165,15 @@ def oauth_return(request, *args, **kwargs):
event.settings.payment_stripe_connect_refresh_token = data['refresh_token']
event.settings.payment_stripe_connect_user_id = data['stripe_user_id']
event.settings.payment_stripe_merchant_country = account.get('country')
if account.get('business_name') or account.get('display_name') or account.get('email'):
if (
account.get('business_profile', {}).get('name')
or account.get('settings', {}).get('dashboard', {}).get('display_name')
or account.get('email')
):
event.settings.payment_stripe_connect_user_name = (
account.get('business_name') or account.get('display_name') or account.get('email')
account.get('business_profile', {}).get('name')
or account.get('settings', {}).get('dashboard', {}).get('display_name')
or account.get('email')
)
if data['livemode']: