KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > lp > samples > JLinkPointLPOrderPartSamples


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
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 JLinkPointLPOrderPartSamples {
20   public static void main(String JavaDoc[] args) {
21
22      System.out.println("\nSAMPLE TRANSACTIONS using LPOrderPart object ");
23
24       // Run credit card sale transactions
25
CreditCardSales();
26       // Run credit card PREAUTH/POSTAUTH/VOID transactions
27
PreAuth_PostAuth_Void();
28       // Run Periodic Billing NEW/MODIFY/CANCEL transactions
29
PeriodicBilling();
30       // Run virtual check SALE/VOID transactions
31
VirtualCheck();
32
33       // Run TAX calculations
34
System.out.println("\n**********************************************************");
35       System.out.println("Sample TAX Calculation Transaction ");
36       System.out.println("**********************************************************");
37       (new TAX()).process();
38       // Run SHIPPING calculations
39
System.out.println("\n**********************************************************");
40       System.out.println("Sample SHIPPING Calculation Transaction ");
41       System.out.println("**********************************************************");
42       (new SHIPPING()).process();
43
44
45   }
46
47   public static void PreAuth_PostAuth_Void()
48   {
49     System.out.println("\n*****************************************************");
50     System.out.println("Sample for PreAuth/PostAuth/Void Credit Card Transactions");
51     System.out.println("******************************************************");
52     System.out.println("\nFirst run PREAUTH");
53
54     JLinkPointSample smpl = new PREAUTH();
55     smpl.process();
56     // check for error
57
if( smpl.R_Error.length() != 0 ) {return;}
58
59     // if all goes well smpl.R_OrderNum holds 'oid'
60
// So we use it to run POSTAUTH
61
System.out.println("\nNow run POSTAUTH transaction using 'oid' recieved");
62     System.out.println("from previous transaction. OID="+smpl.R_OrderNum);
63
64     smpl = new POSTAUTH(smpl.R_OrderNum);
65     smpl.process();
66     // check for error
67
if( smpl.R_Error.length() != 0 ) {return;}
68     // if all goes well smpl.R_OrderNum holds 'oid'
69
// So we use it to run VOID
70
System.out.println("\nNow VOID PreAuth/PostAuth using 'oid' ");
71     System.out.println("from previous transactions. OID="+smpl.R_OrderNum);
72
73     (new VOID(smpl.R_OrderNum)).process();
74
75   }
76
77   public static void PeriodicBilling()
78   {
79     System.out.println("\n*****************************************************");
80     System.out.println("Sample for Sample Periodic Billing Transactions");
81     System.out.println("******************************************************");
82     System.out.println("\nFirst create new Periodic Billing");
83
84     JLinkPointSample smpl = new PB_NEW();
85     smpl.process();
86     // check for error
87
if( smpl.R_Error.length() != 0 ) {return;}
88
89     // if all goes well smpl.R_OrderNum holds 'oid'
90
// So we use it to run MODIFY
91
System.out.println("\nNow modify existing Periodic Billing using 'oid' recieve");
92     System.out.println("from previous transaction. OID="+smpl.R_OrderNum);
93
94     smpl = new PB_MODIFY(smpl.R_OrderNum);
95     smpl.process();
96     // check for error
97
if( smpl.R_Error.length() != 0 ) {return;}
98     // if all goes well smpl.R_OrderNum holds 'oid'
99
// So we use it to run CANCEL
100
System.out.println("\nNow cancel existing Periodic Billing using its 'oid' ");
101     System.out.println("OID="+smpl.R_OrderNum);
102
103     (new PB_CANCEL(smpl.R_OrderNum)).process();
104
105   }
106
107   public static void VirtualCheck()
108    {
109      System.out.println("\n*****************************************************");
110      System.out.println("Sample for Virtual Check Sale/Void Transactions");
111      System.out.println("******************************************************");
112      System.out.println("\nFirst run Sale");
113
114      JLinkPointSample smpl = new VCHECK_SALE();
115      smpl.process();
116      // check for error
117
if( smpl.R_Error.length() != 0 ) {return;}
118
119      // if all goes well smpl.R_OrderNum holds 'oid'
120
// So we use it to run VOID
121
System.out.println("\nNow VOID Virtual Check Sale using 'oid' ");
122      System.out.println("from previous transactions. OID="+smpl.R_OrderNum);
123
124      (new VCHECK_VOID(smpl.R_OrderNum)).process();
125
126    }
127
128   public static void CreditCardSales()
129   {
130
131     System.out.println("\n*****************************************************");
132     System.out.println("Credit Card SALE With Minimum Fields required for AVS");
133     System.out.println("and Card Code fraud prevention measures ");
134     System.out.println("******************************************************");
135     (new AVS_CVM()).process();
136
137     System.out.println("\n*****************************************************");
138     System.out.println("Minimum Required Fields for a FORCED TICKET Transaction");
139     System.out.println("*****************************************************");
140     (new FORCED_TICKET()).process();
141
142     System.out.println("\n**********************************************************");
143     System.out.println("An Example Level 2 Purchasing Card SALE ");
144     System.out.println("**********************************************************");
145     (new L2PURCHASING_CARD()).process();
146
147     System.out.println("\n**********************************************************");
148     System.out.println("Minimum Required Fields for a Credit Card SALE");
149     System.out.println( "**********************************************************");
150     (new SALE_MININFO()).process();
151
152     System.out.println("\n**********************************************************");
153     System.out.println("An Example Credit Card SALE with all commonly used fields included");
154     System.out.println("**********************************************************");
155     (new SALE_MAXINFO()).process();
156
157     System.out.println("\n**********************************************************");
158     System.out.println("Required Fields for Credit Card SALE with ITEMS Transaction");
159     System.out.println("**********************************************************");
160     (new ITEMS_W_ESD()).process();
161
162     System.out.println("\n**********************************************************");
163     System.out.println("Sample of multiple Credit Card PreAuth Transactions");
164     System.out.println("**********************************************************");
165     (new MULTIPLE()).process();
166
167     System.out.println("\n**********************************************************");
168     System.out.println("Sample Retail Keyed Credit Card Transaction ");
169     System.out.println("**********************************************************");
170     (new RETAIL_KEYED()).process();
171
172     System.out.println("\n**********************************************************");
173     System.out.println("Sample Retail Partial AVS Credit Card Transaction ");
174     System.out.println("**********************************************************");
175     (new RETAIL_PARTIAL_AVS()).process();
176
177     System.out.println("\n**********************************************************");
178     System.out.println("Sample Retail Swipe Credit Card Transaction ");
179     System.out.println("**********************************************************");
180     (new RETAIL_SWIPE()).process();
181
182   }
183 }
Popular Tags