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