Skip to content

Commit

Permalink
round amount cents value
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrocolic committed Dec 29, 2023
1 parent 59c1ebe commit b38e688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/fees/subscription_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def initialize_fee(new_amount_cents)
return base_fee unless adjusted_fee

units = adjusted_fee.units
unit_amount_cents = adjusted_fee.unit_amount_cents
unit_amount_cents = adjusted_fee.unit_amount_cents.round
amount_cents = adjusted_fee.adjusted_units? ? (units * new_amount_cents) : (units * unit_amount_cents)
Fee.new(
invoice:,
subscription:,
amount_cents:,
amount_cents: amount_cents.round,
amount_currency: plan.amount_currency,
fee_type: :subscription,
invoiceable_type: 'Subscription',
Expand Down

0 comments on commit b38e688

Please sign in to comment.