Interface Specification (product order)

Source: Internet
Author: User

 PackageCom.fenxiao.channel.quxun;Importjava.io.IOException;ImportJava.util.Map;Importorg.apache.commons.httpclient.HttpClient;Importorg.apache.commons.httpclient.HttpException;ImportOrg.apache.commons.httpclient.methods.PostMethod;ImportOrg.apache.log4j.LogManager;ImportOrg.apache.log4j.Logger;ImportCom.fenxiao.channel.qiannai.util.MD5Util;/*** 2.1. Product Order *@authorWN **/ Public classjiudianjiutest {@SuppressWarnings ("Unused")    PrivateLogger log = Logmanager.getlogger (jiudianjiutest.class); @SuppressWarnings ({"Rawtypes"})     PublicObject Testorder ()throwshttpexception,ioexception{String accountval= "13301516477";//Mobile phone numberString Notifyurl = "https://www.baidu.com/";//Notification callback AddressString OrderNo = "23167771251045981811249827799033";//Channel Order CodeString supplierId = "KEDANG201605042323ERWG";//Channel CodeString spuid = "LT010020";//Product CodeString ts = system.currenttimemillis () + "";//time StampString sign = "";//SignatureString key = "kedang0504";//secret key//Stitching into stringsStringBuffer SB =NewStringBuffer (); Sb.append ("Accountval"). Append (Accountval). Append ("Notifyurl").). Append (Notifyurl). Append ("OrderNo"). Append (OrderNo). Append ("Spuid"). Append (Spuid). Append ("SupplierId"). Append (SupplierId). Append ("TS"). Append (TS). append (key); System.out.println ("33333" +sb.tostring ()); Sign=Md5util.encrypt (sb.tostring ()); String URL= "Http://cz.9dian9.cn/u/stdchn/kedang/charge.xml";//Request AddressHttpClient Client=NewHttpClient (); Client.getparams (). Setcontentcharset ("UTF-8"); Postmethod Postmethod=Newpostmethod (URL); String s= "supplierid=" +supplierid+ "&sign=" +sign+ "&spuid=" +spuid+ "&orderno=" +orderno+ "&accountVal=" + accountval+ "&notifyurl=" +notifyurl+ "&ts=" +ts;                        System.out.println (s); Postmethod.addparameter ("SupplierId", supplierId);//Merchant NumberPostmethod.addparameter ("sign", sign);//SignaturePostmethod.addparameter ("Spuid", Spuid);//Product numberPostmethod.addparameter ("OrderNo", OrderNo);//Serial NumberPostmethod.addparameter ("Accountval", accountval);//Phone numberPostmethod.addparameter ("Notifyurl", Notifyurl);//Callback AddressPostmethod.addparameter ("ts", TS);//DateMap Resultmap =NULL;            Client.executemethod (Postmethod);            System.out.println (Postmethod.getresponsebodyasstring ()); returnResultmap; }         Public Static voidMain (string[] args)throwsHttpException, IOException {jiudianjiutest test=Newjiudianjiutest ();    Test.testorder (); }        }

Interface Specification (product order)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.