mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Stripe Connect error handling
This commit is contained in:
@@ -83,7 +83,7 @@ def oauth_return(request, *args, **kwargs):
|
|||||||
logger.exception('Failed to obtain OAuth token')
|
logger.exception('Failed to obtain OAuth token')
|
||||||
messages.error(request, _('An error occured during connecting with Stripe, please try again.'))
|
messages.error(request, _('An error occured during connecting with Stripe, please try again.'))
|
||||||
else:
|
else:
|
||||||
if data['livemode']:
|
if 'error' not in data and data['livemode']:
|
||||||
try:
|
try:
|
||||||
testresp = requests.post('https://connect.stripe.com/oauth/token', data={
|
testresp = requests.post('https://connect.stripe.com/oauth/token', data={
|
||||||
'grant_type': 'refresh_token',
|
'grant_type': 'refresh_token',
|
||||||
@@ -111,7 +111,8 @@ def oauth_return(request, *args, **kwargs):
|
|||||||
# event.settings.payment_stripe_connect_access_token = data['access_token'] we don't need it, right?
|
# event.settings.payment_stripe_connect_access_token = data['access_token'] we don't need it, right?
|
||||||
event.settings.payment_stripe_connect_refresh_token = data['refresh_token']
|
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_connect_user_id = data['stripe_user_id']
|
||||||
event.settings.payment_stripe_connect_user_name = account['business_name']
|
if account.get('business_name'):
|
||||||
|
event.settings.payment_stripe_connect_user_name = account['business_name']
|
||||||
|
|
||||||
if data['livemode']:
|
if data['livemode']:
|
||||||
event.settings.payment_stripe_publishable_test_key = testdata['stripe_publishable_key']
|
event.settings.payment_stripe_publishable_test_key = testdata['stripe_publishable_key']
|
||||||
|
|||||||
Reference in New Issue
Block a user