KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > SHIPPING


1 /*****************************************************************************
2 ' Copyright 2003 LinkPoint International, Inc. All Rights Reserved.
3 '
4 ' This software is the proprietary information of LinkPoint International, Inc.
5 ' Use is subject to license terms.
6 '
7 '******************************************************************************/

8 package lp.samples;
9 import lp.order.*;
10 /**
11  * <p>Title: </p>
12  * <p>Description: </p>
13  * <p>Copyright: Copyright (c) 2003</p>
14  * <p>Company: LinkPoint International</p>
15  * @author Sergey Chudnovsky
16  * @version 1.0
17  */

18
19 public class SHIPPING extends JLinkPointSample {
20   public SHIPPING() {
21   }
22   protected String JavaDoc getOrderXML() {
23
24    // Create an empty order
25
LPOrderPart order = LPOrderFactory.createOrderPart("order");
26     // Create a part
27
LPOrderPart op = LPOrderFactory.createOrderPart();
28         // Build 'orderoptions'
29
op.put("ordertype","CALCSHIPPING");
30     // add 'orderoptions to order
31
order.addPart("orderoptions", op );
32
33         op.clear();
34         // Build 'merchantinfo'
35
op.put("configfile",configfile);
36     // add 'merchantinfo to order
37
order.addPart("merchantinfo", op );
38
39         op.clear();
40         op.put("carrier","2");
41         op.put("weight","1.2");
42         op.put("total","12.99");
43         op.put("state","CA");
44         op.put("items","1");
45     order.addPart("shipping",op);
46
47 return order.toXML();
48 }
49
50 }
Popular Tags