KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > SALE_MININFO


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 SALE_MININFO extends JLinkPointSample {
20   public SALE_MININFO() {
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","SALE");
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 'billing'
41
// Required for AVS. If not provided,
42
// transactions will downgrade.
43
op.clear();
44       op.put("zip","12345");
45       op.put("addrnum","123");
46       // add 'billing to order
47
order.addPart("billing", op );
48
49       // Build 'creditcard'
50
op.clear();
51       op.put("cardnumber","4111-1111-1111-1111");
52       op.put("cardexpmonth","03");
53       op.put("cardexpyear","05");
54   // add 'creditcard to order
55
order.addPart("creditcard", op );
56
57        // Build 'payment'
58
op.clear();
59       op.put("chargetotal","12.99");
60   // add 'payment to order
61
order.addPart("payment", op );
62
63 // Process the order
64
return order.toXML();
65  }
66
67 }
Popular Tags