KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > VCHECK_SALE


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 VCHECK_SALE extends JLinkPointSample {
20   public VCHECK_SALE() {
21   }
22   protected String JavaDoc getOrderXML() {
23     // Create an empty order
24
LPOrderPart order = LPOrderFactory.createOrderPart("order");
25
26   // Create a part we will use to build the order
27
LPOrderPart op = LPOrderFactory.createOrderPart();
28
29   // Build 'orderoptions'
30
op.put("result","LIVE");
31       op.put("ordertype","SALE");
32   // add 'orderoptions to order
33
order.addPart("orderoptions", op );
34
35
36       // Build 'merchantinfo'
37
op.clear();
38       op.put("configfile",configfile);
39   // add 'merchantinfo to order
40
order.addPart("merchantinfo", op );
41
42
43        // Build 'billing'
44
op.clear();
45       op.put("name","Joe Customer");
46       op.put("address1","123 Broadway");
47       op.put("state","CA");
48       op.put("city","Moorpark");
49       op.put("zip","12345");
50       op.put("phone","8051234567");
51       op.put("email","joe.customer@somewhere.com");
52       // add 'billing to order
53
order.addPart("billing", op );
54
55
56        // Build 'telecheck' part
57
op.clear();
58       op.put("routing","123456789");
59       op.put("account","2139842610");
60       op.put("accounttype","pc");
61       op.put("dl","120381698");
62       op.put("dlstate","CA");
63       op.put("bankname","Wells Fargo");
64       op.put("bankstate","CA");
65   // add 'telecheck' to order
66
order.addPart("telecheck", op );
67
68
69        // Build 'payment'
70
op.clear();
71       op.put("chargetotal","12.99");
72   // add 'payment to order
73
order.addPart("payment", op );
74
75   return order.toXML();
76  }
77
78 }
Popular Tags