From d22c3db4c2a0858eb08426348dbd834c973233d0 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 10 Jul 2023 20:53:02 +0200 Subject: [PATCH] (bug) unable to update payment schedule item --- CHANGELOG.md | 2 ++ lib/pay_zen/service.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a10534d92..ad384088b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog Fab-manager - Fix a bug: unable to confirm payment of store for admin +- Fix a bug: unable to update payment schedule item + ## v6.0.9 2023 July 07 diff --git a/lib/pay_zen/service.rb b/lib/pay_zen/service.rb index f3b15be56..d4d1759a2 100644 --- a/lib/pay_zen/service.rb +++ b/lib/pay_zen/service.rb @@ -24,7 +24,7 @@ class PayZen::Service < Payment::Service rrule: rrule(payment_schedule), order_id: order_id } - unless first_item.details['adjustment']&.zero? && first_item.details['other_items']&.zero? + if first_item.details['adjustment']&.zero? && first_item.details['other_items']&.zero? initial_amount = first_item.amount initial_amount -= payment_schedule.wallet_amount if payment_schedule.wallet_amount if initial_amount.zero? @@ -140,7 +140,7 @@ class PayZen::Service < Payment::Service transaction_date = Time.zone.parse(transaction['creationDate']).to_date amount = payment_schedule_item.amount - if !payment_schedule_item.details['adjustment']&.zero? && payment_schedule_item.payment_schedule.wallet_amount + if payment_schedule_item.details['adjustment']&.zero? && payment_schedule_item.payment_schedule.wallet_amount amount -= payment_schedule_item.payment_schedule.wallet_amount end