KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > PREAUTH


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 PREAUTH extends JLinkPointSample {
20   public PREAUTH() {
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
// For a test, set result to GOOD, DECLINE, or DUPLICATE
31
op.put("result","GOOD");
32        op.put("ordertype","PREAUTH");
33    // add 'orderoptions to order
34
order.addPart("orderoptions", op );
35
36
37        // Build 'merchantinfo'
38
op.clear();
39        op.put("configfile",configfile);
40    // add 'merchantinfo to order
41
order.addPart("merchantinfo", op );
42
43
44        // Build 'creditcard'
45
op.clear();
46        op.put("cardnumber","4111-1111-1111-1111");
47        op.put("cardexpmonth","03");
48        op.put("cardexpyear","05");
49    // add 'creditcard to order
50
order.addPart("creditcard", op );
51
52        // Build 'billing'
53
op.clear();
54        op.put("addrnum","123");
55        op.put("zip","12345");
56        // add 'billing to order
57
order.addPart("billing", op );
58
59         // Build 'payment'
60
op.clear();
61        op.put("chargetotal","12.99");
62    // add 'payment to order
63
order.addPart("payment", op );
64
65  return order.toXML();
66 }
67
68 }
Popular Tags