diff --git a/lib/pagseguro/transaction/serializer.rb b/lib/pagseguro/transaction/serializer.rb index c37395c..4a14641 100644 --- a/lib/pagseguro/transaction/serializer.rb +++ b/lib/pagseguro/transaction/serializer.rb @@ -72,10 +72,10 @@ def serialize_creditor(data) intermediation_fee_amount: BigDecimal(xml.css("creditorFees > intermediationFeeAmount").text.to_f.to_s), installment_fee_amount: BigDecimal(xml.css("creditorFees > installmentFeeAmount").text.to_f.to_s), } - operationalFeeAmount = xml.css("creditorFees > operationalFeeAmount").text - data[:creditor_fees].merge!(operational_fee_amount: BigDecimal(operationalFeeAmount)) if operationalFeeAmount.present? - commissionFeeAmount = xml.css("creditorFees > commissionFeeAmount").text - data[:creditor_fees].merge!(commission_fee_amount: BigDecimal(commissionFeeAmount)) if commissionFeeAmount.present? + operational_fee_amount = xml.css("creditorFees > operationalFeeAmount").text + data[:creditor_fees].merge!(operational_fee_amount: BigDecimal(operational_fee_amount)) if operational_fee_amount.present? + commission_fee_amount = xml.css("creditorFees > commissionFeeAmount").text + data[:creditor_fees].merge!(commission_fee_amount: BigDecimal(commission_fee_amount)) if commission_fee_amount.present? efrete = xml.css("creditorFees > efrete").text data[:creditor_fees].merge!(efrete: BigDecimal(efrete)) if efrete.present? end