Project

General

Profile

Actions

Specification

Programming Guide

Jar version

version Description
1.3 Init

Jar File Download

Jar
Properties
JSP

properties file

  • unionPay.properties
  1. merchant.id - Provided By UnionPay
  2. version - Provided By UnionPay
  3. acpsdk.frontTransUrl - Provided By UnionPay
  4. acpsdk.signCert.path - Provided By UnionPay
  5. acpsdk.signCert.pwd - Provided By UnionPay
  6. acpsdk.signCert.type - Provided By UnionPay
  7. acpsdk.validateCert.dir - Provided By UnionPay
  8. acpsdk.encryptCert.path - Provided By UnionPay
  9. acpsdk.singleMode - Provided By UnionPay

Database Table

CREATE TABLE UNION_INTERFACE (
    ORDER_ID VARCHAR(15) NOT NULL, 
    TRX_TYPE VARCHAR(5),
    SHOPPER_REF_NO INTEGER,
    CURRENCY VARCHAR(3),
    CHARGE_AMT DECIMAL(15,2), 
    QUERY_ID VARCHAR(30),
    ERROR_CODE VARCHAR(20),
    ERROR_DESC VARCHAR(100),
    IS_VALID CHARACTER NOT NULL, 
    CREATE_DATETIME TIMESTAMP NOT NULL,
    MODIFY_DATETIME TIMESTAMP, 
    PRIMARY KEY (ORDER_ID));

Method

com.vmart.union.service.UnionService service = new com.vmart.union.service.UnionService();

Get UnionPay/HTML URL

String url = service.getURL_HTML(Connection conn, PaymentUnion payment);
String url = service.getURL_Redirect(Connection conn, PaymentUnion payment)
  1. conn - Database connection.
  2. payment - PaymentUnion object.
  • orderId - Order ID.
  • amount - Transaction amount. (Must greater than 1)
  • currency - Currency. (Max 3 characters)
  • trxType - Transaction Type.
  • shopperRefNo - Shopper Reference Number.
  • frontURL - Page to be return after transaction.
  • backURL - Backend update transaction status.

updateTransaction

ResponseUnion resultBean = service.updateTransaction(Connection conn, HttpServletRequest request)
  1. conn - Database connection.
  2. payment - ResponseUnion object.
  • errorCode - String
  • errorDesc - String
  • orderId - String
  • trxType - Transaction Type.
  • valid - boolean

Updated by Soh Keong about 4 years ago ยท 1 revisions