Project

General

Profile

Specification » History » Version 24

Soh Keong, 06/05/2012 02:08 PM

1 1 Soh Keong
h1. Specification
2 2 Soh Keong
3 8 Soh Keong
h1. Activity Diagram
4 4 Soh Keong
5 2 Soh Keong
Figure 1 showing the process flow from Mexico mall to TNS Payment Gateway Page.
6
!gw.png!
7 3 Soh Keong
Figure 2 showing the process flow of TNS Payment Gateway redirect back to Mexico Mall.
8 1 Soh Keong
!recv.png!
9 5 Soh Keong
10 8 Soh Keong
h1. Programming Guide
11 5 Soh Keong
12 8 Soh Keong
h2. Resources
13 1 Soh Keong
14 8 Soh Keong
h3. SCM
15 1 Soh Keong
16
see [[wiki#SCM]]
17 8 Soh Keong
18
h3. Classes
19
20
* *my.com.eCosway.tns.commons*      - CommonConstants
21
* *my.com.eCosway.tns.model*        - Transaction, TransCommon, TransResponse
22
* *my.com.eCosway.tns.service*      - TNSService (interface)
23
* *my.com.eCosway.tns.service.impl* - TNSServiceImpl (implementation of interface)
24
* *my.com.eCosway.tns.tnsInterface* - TNSInterfaces (Data Persistence)
25 13 Soh Keong
* *my.com.eCosway.tns.utils*        - CommonUtils, SecureHash, URLUtils
26 8 Soh Keong
* *test.my.com.eCosway.tns.utils*   - SecureHashTest, URLUtilsTest (JUnit Test)
27
28
h3. properties file
29 1 Soh Keong
30
* *transaction.properties*
31
32 8 Soh Keong
   # *vpc_Version*        - The version of the Virtual Payment Client API being used.
33
   # *vpc_Command*        - Indicates the desired operation to be performed.
34
   # *vpc_AccessCode*     - Authenticates the merchant on the Payment Server.
35 13 Soh Keong
   # *vpc_Merchant*       - The Merchant ID identifies the merchant account against which settlements will be made.
36
   # *vpc_Currency*       - The currency of the order expressed as an ISO 4217 alpha code.
37
   # *vpc_Locale*         - Specifies the language used on the Payment Server pages that are displayed to the cardholder, in 3-Party transactions.
38 1 Soh Keong
   # *vpc_SecureHash*     - A secure hash which allows the Virtual Payment Client to authenticate the merchant and check the integrity of the Transaction Request.
39 8 Soh Keong
   # *vpc_SecureHashType* - The type of hash algorithm used to generate the secure hash.
40
   # *vpc_ReturnAuthResponseData* - Specifies whether the authorisation response data must be included in the Transaction Response.
41
42 13 Soh Keong
   * *tns_url*            - Used to redirect user to TNS Payment Page.
43
   * *tns.interface.table.name* - table name of TNS interface.
44
45 12 Soh Keong
h3. Database Table
46 9 Soh Keong
47
<pre>
48
CREATE TABLE ECOS.TNS_INTERFACE (
49 21 Soh Keong
	ORDER_ID VARCHAR(100) NOT NULL, 
50
	CHARGE_AMT DECIMAL(15,2), 
51
	TRX_TYPE VARCHAR(20), 
52 22 Soh Keong
	SHOPPER_REF_NO INTEGER, 
53 21 Soh Keong
	CURRENCY VARCHAR(3),
54
	ERROR_MESSAGE VARCHAR(255), 
55
	RESPONSE_CODE CHARACTER, 
56
	RECEIPT_NO VARCHAR(20), 
57
	TRANSACTION_NO INTEGER, 
58
	AUTHORIZE_ID VARCHAR(6), 
59
	CARD_TYPE VARCHAR(2), 
60
	TRANSACTION_IDENTIFIER VARCHAR(20), 
61
	IS_VALID CHARACTER, 
62
	DATETIME TIMESTAMP,
63
	MODIFY_DATETIME TIMESTAMP, 
64
	PRIMARY KEY (ORDER_ID))
65 1 Soh Keong
</pre>
66 9 Soh Keong
67 11 Soh Keong
h3. Integration
68
69
*redirect to TNS Payment Page*
70 14 Soh Keong
71
<pre>
72 1 Soh Keong
my.com.eCosway.tns.service.TNSService service = new my.com.eCosway.tns.service.impl.TNSServiceImpl();
73
74 24 Soh Keong
String URL = service.getURL(Connection conn, String orderNo, double amount,
75
			String currency, String locale, String returnURL,
76
			String transactionType, int shopperRefNo);
77 23 Soh Keong
</pre>
78 17 Soh Keong
79 24 Soh Keong
# *conn*            - Database connection.
80 11 Soh Keong
# *orderNo*         - The unique order No (1-40 alphanumeric).
81
# *amount*          - The amount of the transaction (1-12 numeric).
82
# *currency*        - The currency of the order expressed as an ISO 4217 alpha code.
83 24 Soh Keong
# *locale*          - Specifies the language used on the Payment Server pages that are displayed to the cardholder.
84 11 Soh Keong
# *returnURL*       - Used by Payment Server to redirect the user back to merchant's web site.
85 1 Soh Keong
# *transactionType* - The Type of Transaction.
86
# *shopperRefNo*    - Member ID.
87
88 14 Soh Keong
*To update TNS Response into Database*
89
90
<pre>
91 24 Soh Keong
my.com.eCosway.tns.model.TransResponse res = new my.com.eCosway.tns.tnsInterface.TNSInterfaces().updateTransaction(Connection conn,
92
			HttpServletRequest request)
93 14 Soh Keong
</pre>