fix refund on corporate tournament

timetoconfirm
Raz 7 months ago
parent 3f95477066
commit 80503c3bd7
  1. 19
      tournaments/services/payment_service.py

@ -313,12 +313,19 @@ class PaymentService:
if payment_intent.status != 'succeeded':
return False, "Le paiement n'a pas été complété, il ne peut pas être remboursé.", None
# Process the refund
refund = stripe.Refund.create(
payment_intent=payment_id,
refund_application_fee=True,
reverse_transfer=True
)
# Process the refund - with different parameters based on tournament type
refund_params = {
'payment_intent': payment_id
}
# Only include transfer reversal for non-corporate tournaments
if not tournament.is_corporate_tournament:
refund_params.update({
'refund_application_fee': True,
'reverse_transfer': True
})
refund = stripe.Refund.create(**refund_params)
for player_reg in player_registrations:
player_reg.payment_type = None

Loading…
Cancel
Save