Skip to content

Commit

Permalink
Allow nil decimal normalization (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbianco-stripe authored Aug 23, 2022
1 parent 4df4209 commit c327a6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/stripe-force/translate/price/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def self.transform_salesforce_billing_type_to_usage_type(raw_usage_type)
end
end

sig { params(unit_amount_decimal: T.any(String, BigDecimal)).returns(BigDecimal) }
sig { params(unit_amount_decimal: T.nilable(T.any(String, BigDecimal))).returns(T.nilable(BigDecimal)) }
def self.normalize_unit_amount_decimal_for_comparison(unit_amount_decimal)
return nil if unit_amount_decimal.nil?

if !unit_amount_decimal.is_a?(BigDecimal)
unit_amount_decimal = BigDecimal(unit_amount_decimal)
end
Expand Down

0 comments on commit c327a6b

Please sign in to comment.