1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

[bugfix] race condition on invoice after payment (concerning payment schedules) https://app.clickup.com/t/25zpmn1

This commit is contained in:
Nicolas Florentin 2022-04-06 16:44:31 +02:00
parent 60e9ccd7ce
commit 16accfca44
2 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- Fix a bug: unable to show machine availability slot for admin
- Fix a bug: unable to confirm modification of reservation for client
- Fix a bug: unable to show deleted user in reservation slot
- Fix a bug: race condition on invoice after payment (concerning payment schedules) https://app.clickup.com/t/25zpmn1
## v5.3.9 2022 April 01

View File

@ -120,6 +120,8 @@ class Stripe::Service < Payment::Service
pgo = PaymentGatewayObject.find_or_initialize_by(item: payment_schedule_item)
pgo.gateway_object = stp_invoice
pgo.save!
elsif stp_invoice.status == 'draft'
return # Could be that the stripe invoice does not yet reflect the payment made by the member, because we called that service just after payment is made. We call return here and PaymentScheduleItemWorker will anyway call that method every hour
else
notify_payment_schedule_item_error(payment_schedule_item)
payment_schedule_item.update_attributes(state: 'error')