Home > Back-end >  How to use Delphi development and man network interface electronic invoice
How to use Delphi development and man network interface electronic invoice

Time:11-03

According to the standard document in the DEMO.
The String
SendUrl="https://nnfpbox.nuonuocs.cn/shop/buyer/allow/cxfKp/cxfServerKpOrderSync.action";
The String order="
{\ "identity " : \ "2329 cc5f90edaa8208f1f3c72a0ce72a713a9d425cd50cde ", \ "the order " : {\ "buye
Rname \ ": " zhejiang love cigna \ "and " taxnum \ ": " 124511234993295177 \ "and " phone \ \ ", \ "0", \ "address ", \ "
Wan tong road, hangzhou city, zhejiang province
\ ", \ "the account ", \ "", \ "telephone \ ", \ "0", \ "orderno " : \ "nuonuo12345 " and \ "invoicedate ", \ "the 2018-10
- 31 19:16:51 \ ", \ "clerk " : \ "Huang Zhi " and \ "saleaccount " : \ "the line
442612010103507108 \ ", \ "salephone " : \ "0774-7893911 " and \ "saleaddress ", \ "fuchuan yao nationality autonomous new
Permanent road 138
Saletaxnum \ ", \ "", \ "339901999999142 " and \ "kptype " : \ "1 " and \ "message ", \ "", \ "payee ", \ "rub Sue
\ ", \ "the checker ", \ "rub Sue
TSFS \ ", \ "", \ "1 ", \ "email " : \ "502192347 @qq.com ", \ "QDBZ " : \ "0 ", \ "QDXMMC ", \ "", \ "DKBZ ", \ "
Deptid 0 \ ", \ "", \ "", \ "clerkid ", \ "", \ "invoiceLine ", \ "p " and \ "cpybz ", \ "", \ "the detail " : [{\ "goodsname
\ ", \ "apple
\ ", \ "num " : \ "1 ", \ "price " : \ "1 ", \ "HSBZ " : \ "1 " and \ "taxrate \ ", \ "0.13", \ "spec ", \ "", \ "unit ", \ "t
SPBM \ ", \ "", \ "10101150101 " and \ "ZSBM ", \ "", \ "FPHXZ " : \ "0 ", \ "yhzcbs " : \ "0 ", \ "ZZSTSGL ", \ "", \ "LSL
Bs \ ": " \ ", \ "kce " : \ \ ""}}}]";

Don't know how to deliver the order request body with INDY, in particular the order \ ": {" buyername such an array of objects, do not know how the code realization,
Directly,

CodePudding user response:


This is a JSON, not an array,

CodePudding user response:

Thank you, but how to pass json, can you help to write a few lines of code, I found the use case are as shown below,
PostStream:=TIdMultiPartFormDataStream. Create;//create TIdMultiPartFormDataStream

PostStream. AddFormField (' textfield ', 'd: \ temp \ test. The PNG');
This how to write the electronic invoice order request body,

CodePudding user response:

You can put him as a string using the rules, joining together directly,
Then send the string directly,

CodePudding user response:

I do think so, but, in the original demo including {} such symbols in json format directly into a string, too? Does not need to be adjusted and,
{' identity ':' 2329 cc5f90edaa8208f1f3c72a0ce72a713a9d425cd50cde ', 'order' : {' buyername ':'
zhejiang love and trustNovartis', 'taxnum' : '124511234993295177... And that's how I spell it,
Please advise, thank you very much,

CodePudding user response:

With TIdHTTP. Post can, need to pay attention to two points, one is his URL is HTTPS, need to take the OpenSSL DLL, online there are a lot of examples, the second is the Delphi string literals are enclosed in single quotation marks, string with single quotes to expressed in continuous two single quotes, but I was single quotation marks with double quotation marks in the JSON can

CodePudding user response:

Don't have to adjust, directly on the strings,

CodePudding user response:

Thanks to the help of the two, I'll give it a try,
  • Related