Project

General

Profile

Specification » History » Revision 17

Revision 16 (Soh Keong, 05/24/2012 09:03 AM) → Revision 17/24 (Soh Keong, 05/24/2012 11:25 AM)

h1. Specification 

 h1. Activity Diagram 

 Figure 1 showing the process flow from Mexico mall to TNS Payment Gateway Page. 
 !gw.png! 
 Figure 2 showing the process flow of TNS Payment Gateway redirect back to Mexico Mall. 
 !recv.png! 

 h1. Programming Guide 

 h2. Resources 

 h3. SCM 

 see [[wiki#SCM]] 

 h3. Classes 

 * *my.com.eCosway.tns.commons*        - CommonConstants 
 * *my.com.eCosway.tns.model*          - Transaction, TransCommon, TransResponse 
 * *my.com.eCosway.tns.service*        - TNSService (interface) 
 * *my.com.eCosway.tns.service.impl* - TNSServiceImpl (implementation of interface) 
 * *my.com.eCosway.tns.tnsInterface* - TNSInterfaces (Data Persistence) 
 * *my.com.eCosway.tns.utils*          - CommonUtils, SecureHash, URLUtils 
 * *test.my.com.eCosway.tns.utils*     - SecureHashTest, URLUtilsTest (JUnit Test) 

 h3. properties file 

 * *transaction.properties* 

    # *vpc_Version*          - The version of the Virtual Payment Client API being used. 
    # *vpc_Command*          - Indicates the desired operation to be performed. 
    # *vpc_AccessCode*       - Authenticates the merchant on the Payment Server. 
    # *vpc_Merchant*         - The Merchant ID identifies the merchant account against which settlements will be made. 
    # *vpc_Currency*         - The currency of the order expressed as an ISO 4217 alpha code. 
    # *vpc_Locale*           - Specifies the language used on the Payment Server pages that are displayed to the cardholder, in 3-Party transactions. 
    # *vpc_SecureHash*       - A secure hash which allows the Virtual Payment Client to authenticate the merchant and check the integrity of the Transaction Request. 
    # *vpc_SecureHashType* - The type of hash algorithm used to generate the secure hash. 
    # *vpc_ReturnAuthResponseData* - Specifies whether the authorisation response data must be included in the Transaction Response. 

    * *tns_url*              - Used to redirect user to TNS Payment Page. 
    * *tns.interface.table.name* - table name of TNS interface. 
    * *java.naming.provider.url* - JNDI Port number, default is 1099. 
    * *data.Source*          - JNDI Name in local-tx-datasource, datasources (db2-ds.xml) 

 h3. Database Table 

 <pre> 
 CREATE TABLE ECOS.TNS_INTERFACE ( 
                   ORDER_ID VARCHAR(100) NOT NULL,  
                   AMOUNT INTEGER,  
                   TXN_TYPE VARCHAR(20),  
                   MEMBER_ID VARCHAR(20),  
                   ERROR_MESSAGE VARCHAR(255),  
                   RESPONSE_CODE CHARACTER,  
                   RECEIPT_NO VARCHAR(20),  
                   TRANSACTION_NO INTEGER,  
                   AUTHORIZE_ID VARCHAR(6),  
                   CARD_TYPE VARCHAR(2),  
                   TRANSACTION_IDENTIFIER VARCHAR(20),  
                   IS_VALID CHARACTER,  
                   LAST_UPDATED TIMESTAMP,  
                  
                   PRIMARY KEY (ORDER_ID)); 
 </pre> 

 h3. Integration 

 *redirect to TNS Payment Page* 

 <pre> 
 my.com.eCosway.tns.service.TNSService service = new my.com.eCosway.tns.service.impl.TNSServiceImpl(); 

 String URL res = service.redirectToPaymentGW(String orderNo, int amount, String locale, String returnURL, 
			 String transactionType, String shopperRefId); shopperRefId, HttpServletResponse response); 
 </pre> 

 # *orderNo*           - The unique order No (1-40 alphanumeric). 
 # *amount*            - The amount of the transaction (1-12 numeric). 
 # *returnURL*         - Used by Payment Server to redirect the user back to merchant's web site. 
 # *transactionType* - The Type of Transaction. 
 # *shopperRefId*      - Member ID. 
 # *response*          - Used to redirect to TNS payment page. 

 *To update TNS Response into Database* 

 <pre> 
 my.com.eCosway.tns.model.TransResponse res = new my.com.eCosway.tns.tnsInterface.TNSInterfaces().updateTransaction(HttpServletRequest request) 
 </pre>