mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
catch for already refunded
This commit is contained in:
parent
e35af8c058
commit
2f0f5c2c01
1 changed files with 5 additions and 1 deletions
|
@ -1361,7 +1361,11 @@ class Site < Sequel::Model
|
||||||
|
|
||||||
if payment_intent.charges.data.any?
|
if payment_intent.charges.data.any?
|
||||||
charge_id = payment_intent.charges.data.first.id
|
charge_id = payment_intent.charges.data.first.id
|
||||||
Stripe::Refund.create({ charge: charge_id })
|
begin
|
||||||
|
Stripe::Refund.create({ charge: charge_id })
|
||||||
|
rescue Stripe::InvalidRequestError => e
|
||||||
|
raise e unless e.message =~ /has already been refunded/
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue