Project

General

Profile

Specification » History » Version 21

Soh Keong, 06/05/2012 09:26 AM

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
   * *java.naming.provider.url* - JNDI Port number, default is 1099.
45
   * *data.Source*        - JNDI Name in local-tx-datasource, datasources (db2-ds.xml)
46
47 12 Soh Keong
h3. Database Table
48 9 Soh Keong
49
<pre>
50
CREATE TABLE ECOS.TNS_INTERFACE (
51 21 Soh Keong
	ORDER_ID VARCHAR(100) NOT NULL, 
52
	CHARGE_AMT DECIMAL(15,2), 
53
	TRX_TYPE VARCHAR(20), 
54
	SHOPPER_REF_NO VARCHAR(20), 
55
	CURRENCY VARCHAR(3),
56
	ERROR_MESSAGE VARCHAR(255), 
57
	RESPONSE_CODE CHARACTER, 
58
	RECEIPT_NO VARCHAR(20), 
59
	TRANSACTION_NO INTEGER, 
60
	AUTHORIZE_ID VARCHAR(6), 
61
	CARD_TYPE VARCHAR(2), 
62
	TRANSACTION_IDENTIFIER VARCHAR(20), 
63
	IS_VALID CHARACTER, 
64
	DATETIME TIMESTAMP,
65
	MODIFY_DATETIME TIMESTAMP, 
66
	PRIMARY KEY (ORDER_ID))
67 1 Soh Keong
</pre>
68 9 Soh Keong
69 11 Soh Keong
h3. Integration
70
71
*redirect to TNS Payment Page*
72 14 Soh Keong
73
<pre>
74 1 Soh Keong
my.com.eCosway.tns.service.TNSService service = new my.com.eCosway.tns.service.impl.TNSServiceImpl();
75 14 Soh Keong
76 21 Soh Keong
String URL = service.getURL(String orderNo, double amount, String currency,
77
			String returnURL, String transactionType, String shopperRefNo);
78 17 Soh Keong
</pre>
79 11 Soh Keong
80
# *orderNo*         - The unique order No (1-40 alphanumeric).
81
# *amount*          - The amount of the transaction (1-12 numeric).
82 21 Soh Keong
# *currency*        - The currency of the order expressed as an ISO 4217 alpha code.
83 11 Soh Keong
# *returnURL*       - Used by Payment Server to redirect the user back to merchant's web site.
84 1 Soh Keong
# *transactionType* - The Type of Transaction.
85 21 Soh Keong
# *shopperRefNo*    - Member ID.
86 14 Soh Keong
87
*To update TNS Response into Database*
88
89
<pre>
90 16 Soh Keong
my.com.eCosway.tns.model.TransResponse res = new my.com.eCosway.tns.tnsInterface.TNSInterfaces().updateTransaction(HttpServletRequest request)
91 14 Soh Keong
</pre>