Actions
Specification » History » Revision 16
« Previous |
Revision 16/18
(diff)
| Next »
chin-yeh, 08/12/2011 03:51 PM
- Table of contents
- Introduction
- Programming Guide
Introduction¶
High level view of the payment flow:
Programming Guide¶
Resources¶
SCM¶
see wiki
Classes¶
- my.com.eCosway.migs.Commons - Commons Constant
- my.com.eCosway.migs.MigsInterface - Data Persistence's Interface
- my.com.eCosway.migs.MigsPaymentUtils - Utility class
- my.com.eCosway.migs.MigsProperties - Data model of MiGS properties
- my.com.eCosway.migs.PaymentResponse - Data model of MiGS's payment response
Properties files¶
- /resources/properties/migs-hkd.properties - MiGS's properties file (HKD currency)
- account.accessCode - VPC API's access code
- account.hashSecret - VPC API's hash secret code
- account.merchantId - MIGS merchant ID
- vpc.twoParty.url - the posting URL for the 2-party integration model
- vpc.threeParty.url - the posting URL for the 3-party integration model
- vpc.version - the VPC version
Test Pages¶
/migs-sample/migs_debug.jsp - to debug the payment response which returned by MiGS /migs-sample/migs_receipt.jsp - a very simple receipt page /migs-sample/migs_test.html - a payment test page /migs-sample/migs_test.jsp - controller for the payment test page
Third-Party Library¶
- log4j - for logging purpose; bundled with Jboss AS
Tables Used¶
- ECOS.MIGS_INTERFACE - This table schema is identical to ECOS.EASYPAY_INTERFACE.
CREATE TABLE ecos.migs_interface ( "CCORNBR" VARCHAR(15) NOT NULL , "TRX_TYPE" VARCHAR(5) , "SHRFNBR" INTEGER , "CARD_TYPE" VARCHAR(10) , "CURRENCY" VARCHAR(3) , "CHARGE_AMT" DECIMAL(15,2) , "STATUS" VARCHAR(5) , "BANK_APPRCODE" VARCHAR(8) , "MALL_IND" CHAR(1) , "DATETIME" TIMESTAMP , "ERROR_MSG" VARCHAR(155) , "UXID" VARCHAR(30) , "REVERSE_FLAG" CHAR(1) ) IN "USERSPACE1" ; ALTER TABLE ecos.migs_interface ADD PRIMARY KEY ("CCORNBR");
How To Integrate¶
To integrate with the MiGS, one must:- Redirect the customer to the MiGS payment page
- Capture the payment response which returned by MiGS, after the customer submitted the payment
One could refer to the following page for demo:
To generate the redirect URL:
- Example:
String redirectUrl = MigsPaymentUtils.genRedirectUrl(MigsCurrency.HKD, locale, orderNo, amount, returnUrl);
- redirectUrl - redirect the user/customer to this URL to make payment
- MigsCurrency.HKD - the currency of the payment
- locale - the display language of the MiGS payment page, e.g. en_US
- English - en, en_US
- Simplified Chinese - zh_CN
- Traditional Chinese - zh_TW
- orderNo - the unique order number (1-40 alphanumeric)
- amount - the amount of the payment in cents (1-12 numeric)
- returnUrl - MiGS will redirect the user to this page after made the payment (1-255 alphanumeric)
- Example:
String orderNo = MigsPaymentUtils.persistPaymentStatus(connection, request);
- orderNo - the order number of the payment
- connection - an established database connection where the payment interface table resides, e.g. MIGS_INTERFACE
- request - the HTTPServletRequest object
- Refer to the STATUS column in the interface table to check if the payment is success
- YES - success
- NO - failed
- refer to ERROR_MSG column in the interface table for more details
Updated by chin-yeh over 13 years ago · 16 revisions