forked from CGM_Public/pretix_original
Fix Stripe refunds for PaymentIntents
This commit is contained in:
@@ -451,7 +451,12 @@ class StripeMethod(BasePaymentProvider):
|
|||||||
raise PaymentException(_('No payment information found.'))
|
raise PaymentException(_('No payment information found.'))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ch = stripe.Charge.retrieve(payment_info['id'], **self.api_kwargs)
|
if payment_info['id'].startswith('pi_'):
|
||||||
|
chargeid = payment_info['charges']['data'][0]['id']
|
||||||
|
else:
|
||||||
|
chargeid = payment_info['id']
|
||||||
|
|
||||||
|
ch = stripe.Charge.retrieve(chargeid, **self.api_kwargs)
|
||||||
r = ch.refunds.create(
|
r = ch.refunds.create(
|
||||||
amount=self._get_amount(refund),
|
amount=self._get_amount(refund),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user