Project

General

Profile

Actions

Specification

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

Programming Guide

Resources

SCM

see wiki

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)

properties file

  • transaction.properties
    1. vpc_Version - The version of the Virtual Payment Client API being used.
    2. vpc_Command - Indicates the desired operation to be performed.
    3. vpc_AccessCode - Authenticates the merchant on the Payment Server.
    4. vpc_Merchant - The Merchant ID identifies the merchant account against which settlements will be made.
    5. vpc_Currency - The currency of the order expressed as an ISO 4217 alpha code.
    6. vpc_Locale - Specifies the language used on the Payment Server pages that are displayed to the cardholder, in 3-Party transactions.
    7. vpc_SecureHash - A secure hash which allows the Virtual Payment Client to authenticate the merchant and check the integrity of the Transaction Request.
    8. vpc_SecureHashType - The type of hash algorithm used to generate the secure hash.
    9. 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.

Database Table

CREATE TABLE ECOS.TNS_INTERFACE (
    ORDER_ID VARCHAR(100) NOT NULL, 
    CHARGE_AMT DECIMAL(15,2), 
    TRX_TYPE VARCHAR(20), 
    SHOPPER_REF_NO INTEGER, 
    CURRENCY VARCHAR(3),
    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, 
    DATETIME TIMESTAMP,
    MODIFY_DATETIME TIMESTAMP, 
    PRIMARY KEY (ORDER_ID))

Integration

redirect to TNS Payment Page

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

String URL = service.getURL(Connection conn, String orderNo, double amount,
            String currency, String locale, String returnURL,
            String transactionType, int shopperRefNo);
  1. conn - Database connection.
  2. orderNo - The unique order No (1-40 alphanumeric).
  3. amount - The amount of the transaction (1-12 numeric).
  4. currency - The currency of the order expressed as an ISO 4217 alpha code.
  5. locale - Specifies the language used on the Payment Server pages that are displayed to the cardholder.
  6. returnURL - Used by Payment Server to redirect the user back to merchant's web site.
  7. transactionType - The Type of Transaction.
  8. shopperRefNo - Member ID.

To update TNS Response into Database

my.com.eCosway.tns.model.TransResponse res = new my.com.eCosway.tns.tnsInterface.TNSInterfaces().updateTransaction(Connection conn,
            HttpServletRequest request)

Updated by Soh Keong over 12 years ago ยท 24 revisions