forked from CGM_Public/pretix_original
Except when triggered by a webhook.
This commit is contained in:
committed by
Raphael Michel
parent
2de328a33b
commit
d13198167a
@@ -221,7 +221,7 @@ class Paypal(BasePaymentProvider):
|
|||||||
payment_info = None
|
payment_info = None
|
||||||
|
|
||||||
if not payment_info:
|
if not payment_info:
|
||||||
mark_order_refunded(order)
|
mark_order_refunded(order, user=request.user)
|
||||||
messages.warning(request, _('We were unable to transfer the money back automatically. '
|
messages.warning(request, _('We were unable to transfer the money back automatically. '
|
||||||
'Please get in touch with the customer and transfer it back manually.'))
|
'Please get in touch with the customer and transfer it back manually.'))
|
||||||
return
|
return
|
||||||
@@ -239,7 +239,7 @@ class Paypal(BasePaymentProvider):
|
|||||||
'Please get in touch with the customer and transfer it back manually.'))
|
'Please get in touch with the customer and transfer it back manually.'))
|
||||||
else:
|
else:
|
||||||
sale = paypalrestsdk.Payment.find(payment_info['id'])
|
sale = paypalrestsdk.Payment.find(payment_info['id'])
|
||||||
order = mark_order_refunded(order)
|
order = mark_order_refunded(order, user=request.user)
|
||||||
order.payment_info = json.dumps(sale.to_dict())
|
order.payment_info = json.dumps(sale.to_dict())
|
||||||
order.save()
|
order.save()
|
||||||
|
|
||||||
|
|||||||
@@ -202,10 +202,10 @@ class Stripe(BasePaymentProvider):
|
|||||||
'support if the problem persists.'))
|
'support if the problem persists.'))
|
||||||
logger.error('Stripe error: %s' % str(err))
|
logger.error('Stripe error: %s' % str(err))
|
||||||
except stripe.error.StripeError:
|
except stripe.error.StripeError:
|
||||||
mark_order_refunded(order)
|
mark_order_refunded(order, user=request.user)
|
||||||
messages.warning(request, _('We were unable to transfer the money back automatically. '
|
messages.warning(request, _('We were unable to transfer the money back automatically. '
|
||||||
'Please get in touch with the customer and transfer it back manually.'))
|
'Please get in touch with the customer and transfer it back manually.'))
|
||||||
else:
|
else:
|
||||||
order = mark_order_refunded(order)
|
order = mark_order_refunded(order, user=request.user)
|
||||||
order.payment_info = str(ch)
|
order.payment_info = str(ch)
|
||||||
order.save()
|
order.save()
|
||||||
|
|||||||
@@ -55,6 +55,6 @@ def webhook(request, *args, **kwargs):
|
|||||||
order.log_action('pretix.plugins.stripe.event', data=event_json)
|
order.log_action('pretix.plugins.stripe.event', data=event_json)
|
||||||
|
|
||||||
if order.status == Order.STATUS_PAID and (charge['refunds']['total_count'] or charge['dispute']):
|
if order.status == Order.STATUS_PAID and (charge['refunds']['total_count'] or charge['dispute']):
|
||||||
mark_order_refunded(order)
|
mark_order_refunded(order, user=None)
|
||||||
|
|
||||||
return HttpResponse(status=200)
|
return HttpResponse(status=200)
|
||||||
|
|||||||
Reference in New Issue
Block a user