1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(bug) unable to update status to paid for latest payment schedule item

This commit is contained in:
Du Peng 2023-08-30 18:47:39 +02:00
parent 0f7f32f256
commit 5e621b0615
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## next deploy
- Fix a bug: for project categories, if there is no category : do not show categories panel in show view, do not show categories input field in edit view
- Fix a bug: unable to update status to paid for latest payment schedule item
## v6.0.13 2023 August 28

View File

@ -87,6 +87,7 @@ class PayZen::Service < Payment::Service
def process_payment_schedule_item(payment_schedule_item)
pz_subscription = payment_schedule_item.payment_schedule.gateway_subscription.retrieve
if pz_subscription['answer']['cancelDate'] && Time.zone.parse(pz_subscription['answer']['cancelDate']) <= Time.current
&& pz_subscription['answer']['pastPaymentsNumber'] != pz_subscription['answer']['totalPaymentsNumber']
# the subscription was canceled by the gateway => notify & update the status
notify_payment_schedule_gateway_canceled(payment_schedule_item)
payment_schedule_item.update(state: 'gateway_canceled')