KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > process > PaymentProcess


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Smart Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.process;
15
16 import java.sql.*;
17 import java.math.*;
18 import java.util.*;
19
20 import org.compiere.process.*;
21 import org.compiere.model.*;
22
23
24 /**
25  * Online Payment Process
26  *
27  * @author Jorg Janke
28  * @version $Id: PaymentProcess.java,v 1.2 2003/08/04 03:54:46 jjanke Exp $
29  */

30 public class PaymentProcess extends SvrProcess
31 {
32     public PaymentProcess()
33     {
34         super();
35     } // PaymentProcess
36

37     private int m_C_Payment_ID = -1;
38
39     /**
40      * Prepare - e.g., get Parameters.
41      */

42     protected void prepare()
43     {
44         ProcessInfoParameter[] para = getParameter();
45         for (int i = 0; i < para.length; i++)
46         {
47             String JavaDoc name = para[i].getParameterName();
48             if (para[i].getParameter() == null)
49                 ;
50             else
51                 log.error("prepare - Unknown Parameter: " + name);
52         }
53     } // prepare
54

55     /**
56      * Perrform process.
57      * @return Message
58      * @throws Exception
59      */

60     protected String JavaDoc doIt() throws Exception JavaDoc
61     {
62         log.info("doIt - Record_ID=" + getRecord_ID());
63         // get Payment
64
MPayment pp = new MPayment (getCtx(), getRecord_ID());
65         // Process it
66
boolean ok = pp.processOnline();
67         pp.save();
68         return ok ? "" : "Error";
69     } // doIt
70

71 } // PaymentProcess
72
Popular Tags