KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > FORCED_TICKET


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 FORCED_TICKET extends JLinkPointSample {
20   public FORCED_TICKET() {
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("ordertype","POSTAUTH");
31   // add 'orderoptions to order
32
order.addPart("orderoptions", op );
33
34       // Build 'merchantinfo'
35
op.clear();
36       op.put("configfile",configfile);
37   // add 'merchantinfo to order
38
order.addPart("merchantinfo", op );
39
40       // Build 'transactiondetails'
41
op.clear();
42       op.put("reference_number","NEW987654");
43       // add 'billing to order
44
order.addPart("transactiondetails", op );
45
46       // Build 'creditcard'
47
op.clear();
48       op.put("cardnumber","4111-1111-1111-1111");
49       op.put("cardexpmonth","03");
50       op.put("cardexpyear","05");
51   // add 'creditcard to order
52
order.addPart("creditcard", op );
53
54        // Build 'payment'
55
op.clear();
56       op.put("chargetotal","12.99");
57   // add 'payment to order
58
order.addPart("payment", op );
59
60 // Process the order
61
return order.toXML();
62 }
63
64 }
Popular Tags