Transportation for batch is sftp and this part describes how/where you upload and download files over SFTP and how you should work with the flow. On the server, the files must be placed in a specific folder.
Note make sure to use the batch folder, there are also the reports folder where you will not be able to write.
When uploading the batch file and downloading reports, SFTP is used. The API is not solely built upon SFTP rather a combination of JSON-RPC and then SFTP for transferring the data. It’s important to understand the flow, and it’s driven by the JSON-api, which instructs Trustly to look for a specific file on the SFTP server. Reporting status for the payments happens the same way, eg Trustly will upload the report file and once there send the notification that the report is available.
Create the CSV-File according to the specification and name it to something unique, eg request-20230215.csv.
Calculate the MD5 checksum of the file (eg on osx/linux, ‘md5sum file’)
Upload the CSV-File to the SFTP server
Create the DirectDebitBatchCharge request and set the value of BatchFile and Checksum to the values from above (1 & 2)
When receiving the notification, respond back to Trustly that the notification has been received.
Download the report from the SFTP server based on the information in the batch notification
Process each row in the CSV and update your internal status for each payment.