Source Code Cross Referenced for ABCGatewayAdapter.java in  » Development » jdepend-2.9 » epayment » adapters » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jdepend 2.9 » epayment.adapters 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package epayment.adapters;
002:
003:        import epayment.adapters.*;
004:
005:        import epayment.framework.IGatewayAdapter;
006:        import epayment.framework.IPaymentRequest;
007:        import epayment.framework.IPaymentResponse;
008:        import epayment.framework.PaymentException;
009:        import epayment.response.PaymentResponse;
010:
011:        /**
012:         * The <code>ABCGatewayAdapter</code> class is an
013:         * <code>IGatewayAdapter</code> which adapts
014:         * to a vendor-specific epayment package.
015:         * <p>
016:         * This class is strictly an example.
017:         *
018:         * @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
019:         * @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
020:         */
021:
022:        public class ABCGatewayAdapter implements  IGatewayAdapter {
023:
024:            //
025:            // Vendor-specific proxy class.
026:            //
027:            //private ABCProxy _proxy;
028:
029:            /**
030:             * Constructs an <code>ABCGatewayAdapter</code> instance.
031:             */
032:            public ABCGatewayAdapter() {
033:                //_proxy = new ABCProxy();
034:            }
035:
036:            /**
037:             * Sets the payment gateway host.
038:             *
039:             * @param host Gateway host.
040:             */
041:            public void setHost(String host) {
042:                //_proxy.setGatewayHostName(host);		
043:            }
044:
045:            /** 
046:             * Performs an authorize for the specified payment request 
047:             * information and returns a payment response.
048:             *
049:             * @param request Payment request.
050:             * @return Payment response.
051:             * @throws PaymentException If an error occurs.
052:             */
053:            public IPaymentResponse authorize(IPaymentRequest request)
054:                    throws PaymentException {
055:
056:                PaymentResponse response = new PaymentResponse();
057:
058:                //
059:                // Adapt the request information to the 
060:                // vendor-specific proxy API.
061:                //
062:                /*
063:                _proxy.setAction("authorize");
064:                _proxy.setUserId(request.getUserId());
065:                _proxy.setPassword(request.getUserPassword());		
066:                _proxy.setAccountHolderName(request.getAccountName());
067:                _proxy.setAccountHolderNumber(request.getAccountNumber());
068:                _proxy.setUserDefinedField1(request.getComment());
069:                _proxy.setTransactionAmount(request.getAmount());
070:                 */
071:
072:                //
073:                // Perform the transaction against
074:                // the vendor-specific API.
075:                //
076:                /*	
077:                boolean success = false;
078:                try {
079:                
080:                	success = _proxy.performTransaction();
081:                
082:                } catch (Exception e) {
083:                	throw new PaymentException(e.getMessage());
084:                }
085:                 */
086:
087:                //
088:                // Adapt the vendor-specific response information 
089:                // to the generic response API.
090:                //		
091:                /*
092:                if (success) {
093:                
094:                	response.setResponseMessage(_proxy.getResult());
095:                	response.setProcessedDate(_proxy.getDate());
096:                
097:                } else {
098:                	throw new PaymentException(_proxy.getResult());
099:                }
100:                 */
101:
102:                return response;
103:            }
104:
105:            /** 
106:             * Performs a capture for the specified payment 
107:             * request information and returns a payment response.
108:             *
109:             * @param request Payment request.
110:             * @return Payment response.
111:             * @throws PaymentException If an error occurs.
112:             */
113:            public IPaymentResponse capture(IPaymentRequest request)
114:                    throws PaymentException {
115:
116:                // similar to authorize()
117:
118:                return new PaymentResponse();
119:            }
120:
121:            /** 
122:             * Performs a sale (authorize and capture) for the specified 
123:             * payment request information and returns a payment response.
124:             *
125:             * @param request Payment request.
126:             * @return Payment response.
127:             * @throws PaymentException If an error occurs.
128:             */
129:            public IPaymentResponse sale(IPaymentRequest request)
130:                    throws PaymentException {
131:
132:                // similar to authorize()
133:
134:                return new PaymentResponse();
135:            }
136:
137:            /** 
138:             * Performs a credit for the specified payment request 
139:             * information and returns a payment response.
140:             *
141:             * @param request Payment request.
142:             * @return Payment response.
143:             * @throws PaymentException If an error occurs.
144:             */
145:            public IPaymentResponse credit(IPaymentRequest request)
146:                    throws PaymentException {
147:
148:                // similar to authorize()
149:
150:                return new PaymentResponse();
151:            }
152:
153:            /** 
154:             * Performs a void for the specified payment request 
155:             * information and returns a payment response.
156:             *
157:             * @param request Payment request.
158:             * @return Payment response.
159:             * @throws PaymentException If an error occurs.
160:             */
161:            public IPaymentResponse voidSale(IPaymentRequest request)
162:                    throws PaymentException {
163:
164:                // similar to authorize()
165:
166:                return new PaymentResponse();
167:            }
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.