KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > AVS_CVM


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 AVS_CVM extends JLinkPointSample {
20   public AVS_CVM() {
21   }
22
23   protected String JavaDoc getOrderXML() {
24     // Create an empty order
25
LPOrderPart order = LPOrderFactory.createOrderPart("order");
26
27    // Create a part we will use to build the order
28
LPOrderPart op = LPOrderFactory.createOrderPart();
29
30    // Build 'orderoptions'
31
op.put("ordertype","SALE");
32    // add 'orderoptions to order
33
order.addPart("orderoptions", op );
34
35        // Build 'merchantinfo'
36
op.clear();
37        op.put("configfile",configfile);
38    // add 'merchantinfo to order
39
order.addPart("merchantinfo", op );
40
41        // Build 'billing'
42
op.clear();
43        op.put("zip","87123");
44        op.put("addrnum","123");
45        // add 'billing to order
46
order.addPart("billing", op );
47
48   // Build 'creditcard'
49
op.clear();
50        op.put("cardnumber","4111-1111-1111-1111");
51        op.put("cardexpmonth","03");
52        op.put("cardexpyear","05");
53        op.put("cvmvalue","123");
54        op.put("cvmindicator","provided");
55    // add 'creditcard to order
56
order.addPart("creditcard", op );
57
58   // Build 'payment'
59
op.clear();
60    op.put("chargetotal","12.99");
61    // add 'payment to order
62
order.addPart("payment", op );
63
64   return order.toXML();
65   }
66
67 }
Popular Tags