KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > VOID


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 VOID extends JLinkPointSample {
20   public VOID() {
21   }
22   public VOID(String JavaDoc _oid) {
23   oid = _oid;
24   }
25   protected String JavaDoc getOrderXML() {
26     // Create an empty order
27
LPOrderPart order = LPOrderFactory.createOrderPart("order");
28
29  // Create a part we wanna use to build the order
30
LPOrderPart op = LPOrderFactory.createOrderPart();
31
32  // Build 'orderoptions'
33
// For a test, set result to GOOD, DECLINE, or DUPLICATE
34
op.put("result","GOOD");
35      op.put("ordertype","VOID");
36  // add 'orderoptions to order
37
order.addPart("orderoptions", op );
38
39
40      // Build 'merchantinfo'
41
op.clear();
42      op.put("configfile",configfile);
43  // add 'merchantinfo to order
44
order.addPart("merchantinfo", op );
45
46
47      // Build 'creditcard'
48
op.clear();
49      op.put("cardnumber","4111-1111-1111-1111");
50      op.put("cardexpmonth","03");
51      op.put("cardexpyear","05");
52  // add 'creditcard to order
53
order.addPart("creditcard", op );
54
55
56       // Build 'payment'
57
op.clear();
58      op.put("chargetotal","12.99");
59  // add 'payment to order
60
order.addPart("payment", op );
61
62       // Add oid
63
op.clear();
64      op.put("oid",oid);
65  // add 'transactiondetails to order
66
order.addPart("transactiondetails", op );
67
68 return order.toXML();
69 }
70
71 private String JavaDoc oid="";
72
73 }
Popular Tags