I am performing tests in karate framework, where I must send a payload that contains a security certificate, in postman the response is satisfactory, but when performing the same operation in karate, it returns error 400, according to what I have investigated, karate changes the format of my payload (example: beautufy), this causes spaces to be added and the API response to be 400, since the JSON was not valid:
this is payload:
{
"data": {
"initiation": {
"creditor_account": {
"account_type": "CUENTA_CORRIENTE",
"bank_id": "0031",
"account_schema": "BICECONNECT.PAYMENTS",
"identification": "90354",
"user_identification": {
"name": "Abono",
"id_schema": "CLID",
"id": "963708",
"email": "algo@bice.cl"
}
},
"debtor_account": {
"account_type": "CUENTA_CORRIENTE",
"bank_id": "0028",
"account_schema": "BICECONNECT.PAYMENTS",
"identification": "01362364",
"user_identification": {
"name": "Cargo",
"id_schema": "CLID",
"id": "44",
"email": "algo@bice.cl"
}
},
"instructed_amount": {
"amount": "901",
"currency": "CLP"
},
"sender": {
"id_schema": "BICECONNECT.SENDER",
"id": "Shinka",
"transaction_id": "d58093ca-f9f5-ef-5143e2d41ba4",
"creation_date": "2022-11-04T18:02:14.574",
"callback_url": "https://postman-echo.com/post"
},
"transaction_details": {
"transaction_type": "payout",
"transaction_subtype": "transferencia",
"transaction_route": "CCA",
"description": "Paciencia, el apuro no conduce a nada"
}
}
},
"attachments": {
"original_message": {
"protected": "<secret-string>",
"payload": "{\"document\":{\"header\":{\"message_id\":\"f9841bc5-d03c-4364-bcd8-ea0caf8b1c8b\",\"creation_date\":\"2022-11-04T18:02:14.574\",\"sender\":{\"fin_id_schema\":\"SHINKANSEN\",\"fin_id\":\"BUK\"},\"receiver\":{\"fin_id_schema\":\"BICECONNECT.SENDER\",\"fin_id\":\"Shinkansen\"}},\"transactions\":[{\"transaction_type\":\"payout\",\"transaction_id\":\"d58093ca-f9f5-4a70-8def-5143e2d41ba4\",\"currency\":\"CLP\",\"amount\":\"901\",\"execution_date\":\"2022-11-04T18:02:14.574\",\"description\":\"Paciencia, el apuro no conduce a nada\",\"debtor\":{\"name\":\"Cargo\",\"email\":\"sebastian.fuenzalida@bice.cl\",\"identification\":{\"id_schema\":\"CLID\",\"id\":\"8000000001\"},\"financial_institution\":{\"fin_id_schema\":\"BICECONNECT.PAYMENTS\",\"fin_id\":\"0028\"},\"account_type\":\"CUENTA_CORRIENTE\",\"account\":\"01362364\"},\"creditor\":{\"name\":\"Abono\",\"email\":\"rafael.cruz@bice.cl\",\"identification\":{\"id_schema\":\"CLID\",\"id\":\"967713708\"},\"financial_institution\":{\"fin_id_schema\":\"BICECONNECT.PAYMENTS\",\"fin_id\":\"0031\"},\"account_type\":\"CUENTA_CORRIENTE\",\"account\":\"4\"}}]}}",
"signature": "<signature-string>"
}
}
}
I expected a 201 as an answer
pdta: the payload I sent is copied from another API response, which comes with text