I need to integrate with a third-party service that sends me a JSON array in the event body.
Something like this:
“[{“id”:“00012572000000133723”,“dataRegistro”:“15.03.2021”,“dataVencimento”:“08.06.2021”,“valorOriginal”:14900,“valorPagoSacado”:344.6,“numeroConvenio”:1257200,“numeroOperacao”:618843,“carteiraConvenio”:17,“variacaoCarteiraConvenio”:19,“codigoEstadoBaixaOperacional”:2,“dataAgendamento”:“25/03/2021 05:37:00”,“instituicaoAgendamento”:60746948,“canalAgendamento”:3,“codigoModalidadeBoleto”:1},{“id”:“00012572000000133724”,“dataRegistro”:“15.03.2021”,“dataVencimento”:“25.03.2021”,“valorOriginal”:217,“valorPagoSacado”:344.6,“numeroConvenio”:1257200,“numeroOperacao”:618843,“carteiraConvenio”:17,“variacaoCarteiraConvenio”:19,“codigoEstadoBaixaOperacional”:2,“dataAgendamento”:“25/03/2021 05:37:00”,“instituicaoAgendamento”:60746948,“canalAgendamento”:3,“codigoModalidadeBoleto”:1}]”
However, when Jets::Controller::Params tires to params.deep_merge(body_params) it gives me an TypeError (no implicit conversion of Array into Hash).
Well, it is indeed an array and I do not control the sender.
Any tips?