yopenedi
OpenTrans 2.1/EDIFACT D.96A File converter
- Convert order Files to and from OpenTrans 2.1/EDIFACT D.96A
Focus on the opening UNH/UNT Tags. They contain the order information like Buyer, Seller, Contact Address and itmes list. UNB is just the message header. Each order file will only contain one combination of UNH/UNT that needs be converted into Opentrans 2.1 XML (Sample Order XML Files from OpenTrans 2.1) - Send order files as attachment in EDIFACT D.96A format to an IMAP Email address and convert them to the OpenTrans 2.1 format.
- Send order files to a domain i.e. https://test.yopenedi.ch/as2 using the AS2 standard according to MIME-Based Secure Peer-to-Peer Business Data Interchange Using HTTP, Applicability Statement 2 (AS2)
- Import OpenTrans 2.1 files from FTP and convert them to EDIFACT D.96A and send the converted file as Email-Attachment from an IMAP Email address to a dedicated Email address.
- Send Opentrans 2.1 XML files to this URL
- Receive Opentrans 2.1 XML files at this URL
FAQ
EDIFACT D.96A
- Stackoverflow
** Just split at the sytax chars: first at'
to get the segments, than at+
to get data elements of that segments and at:
to get the individual components. - edifact-parser
- Truugo
- Edicat
- Edivisualizer
Useful Windows Tools
Opentrans 2.1
AS2 Gateway
- https://medium.com/@manjulapiyumal/getting-start-with-as2-protocol-using-as2gateway-and-openas2-796249cfd3ac
- https://github.com/OpenAS2/OpenAs2App
- https://github.com/abhishek-ram/django-pyas2
Send AS2 message with Curl
- https://stackoverflow.com/questions/42390232/edi-as2-http-trace
- https://docs.axway.com/bundle/B2Bi_230_AdministratorsGuide_allOS_en_HTML5/page/Content/Transports/Secure_file/curl_tool.htm
Certbot for Ubuntu 20.04
- https://certbot.eff.org/lets-encrypt/ubuntufocal-other
certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d 'test.yopenedi.ch'
Digital Ocean deployment
Input and Output files
- Input files:
yopenedi/edifact_orders
- Output files:
yopenedi/opentrans_orders
Meteor setup
curl https://install.meteor.com/ | sh
meteor npm i
meteor --settings settings.json
settings
- "resetDB": true, remove all records from the database. It requires to change the value after the first reset run into, "resetDB": false.
- "imap": imap connection configuration.
{
"public":{
},
"private":{
"resetDB":false,
"imap":{
"username":"email",
"password":"pass",
"host": "imap locatio.....",
"post": "port",
"secure": true
}
}
}
Apache setup
<VirtualHost *:80>
ServerName test.yopenedi.ch
Redirect permanent / https://test.yopenedi.ch
</VirtualHost>
<VirtualHost 104.248.255.2:443>
ServerName test.yopenedi.ch
ProxyPreserveHost On
ProxyPass /excluded !
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/test.yopenedi.ch/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/test.yopenedi.ch/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/test.yopenedi.ch/chain.pem
</VirtualHost>
settings.json
{
"public":{
},
"private":{
"isDev":false,
"checkEmail":false,
"resetDB":false,
"imap":{
"username":"user@domain.com",
"password":"password",
"host": "imap.gmail.com",
"post": "993",
"secure": true
}
}
meteor reset
removes all sqlite files and recreates an empty DB, which is not friendly at all if you have files bigger then 100MB on a slow testing machine.resetDB
insettings.json
is removing the DB entries asItems.remove({})
. It will remove all DB records related to the choosen collection.checkEmail
disable/enable IMAP polling, every 5 minutes.isDev
is for developers.