You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This caused an error when I went to production. This code generated a commission value of R$ 1 in an item that costs R$ 100:
commissions << MyMoip::Commission.new(
reason: "Venda de curso na escola #{current_school.name}",
receiver_login: current_school.moip_login,
percentage_value: 1.0
)
I got no time right now to contribute to the project, so I fixed it locally overring the commission "to_xml" method:
module MyMoip
class Commission
def to_xml(root = nil)
raise InvalidComission if invalid?
if root.nil?
xml = ""
root ||= Builder::XmlMarkup.new(target: xml)
end
root.Comissionamento do |n1|
n1.Razao(reason)
n1.Comissionado {|n2| n2.LoginMoIP(receiver_login)}
n1.ValorFixo(fixed_value) if fixed_value
n1.ValorPercentual(percentage_value*100) if percentage_value
end
xml
end
end
end
It's working, including in production. The commissions are being generated ok now.
The text was updated successfully, but these errors were encountered:
In Moip documentation (https://labs.moip.com.br/parametro/comissoes/) the commissions with percentage values are not from 0 to 1, but from 0 to 100:
This caused an error when I went to production. This code generated a commission value of R$ 1 in an item that costs R$ 100:
I got no time right now to contribute to the project, so I fixed it locally overring the commission "to_xml" method:
It's working, including in production. The commissions are being generated ok now.
The text was updated successfully, but these errors were encountered: