Specification » History » Version 10
Soh Keong, 07/19/2022 11:38 AM
1 | 1 | Soh Keong | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. Specification |
||
4 | |||
5 | h1. Activity Diagram |
||
6 | |||
7 | !atome_open_api_flowchart.jpg! |
||
8 | |||
9 | h1. Programming Guide |
||
10 | |||
11 | h2. Jar version |
||
12 | |||
13 | |_. version |_. Description | |
||
14 | | 1.0 | Init | |
||
15 | 8 | Soh Keong | | 1.1 | without customer info | |
16 | 9 | Soh Keong | | 1.2 | Added Taiwan | |
17 | 1 | Soh Keong | |
18 | h2. Jar File Download |
||
19 | |||
20 | 9 | Soh Keong | "Jar":/redmine/attachments/download/668/atome-1.2.jar |
21 | 3 | Soh Keong | "Properties":/redmine/attachments/download/647/atome.properties |
22 | 1 | Soh Keong | |
23 | h3. Classes |
||
24 | |||
25 | * *com.atome.common* - CommonConstant, CommonProperties |
||
26 | * *com.atome.dao* - AtomeInterface |
||
27 | * *com.atome.model* - AtomeCommonBean, AtomeRequestBean, AtomeResponseBean, CustomerInfoBean, PaymentTransaction, ProductBean, ShippingAddressBean |
||
28 | * *com.atome.service* - AtomeService |
||
29 | * *com.atome.util* - HttpManager |
||
30 | |||
31 | h3. properties file |
||
32 | |||
33 | * *atome.properties* |
||
34 | |||
35 | # *payment.url* - |
||
36 | # *api.key.[myr]* - [myr] for Malaysia; [sgd] for Singapore etc. |
||
37 | # *api.secret.[myr]* - [myr] for Malaysia; [sgd] for Singapore etc. |
||
38 | # *connection.connect.timeout* - |
||
39 | # *connection.read.timeout* - |
||
40 | 3 | Soh Keong | # *data.default.mobile* - |
41 | # *data.default.country* - |
||
42 | # *data.default.address* - |
||
43 | # *data.default.postcode* - |
||
44 | # *data.default.prodId* - |
||
45 | # *data.default.prodName* - |
||
46 | # *data.default.expiryTime* - |
||
47 | 1 | Soh Keong | |
48 | h2. Database Table |
||
49 | |||
50 | <pre> |
||
51 | 2 | Soh Keong | CREATE TABLE ATOME_INTERFACE ( |
52 | ORDER_ID VARCHAR(15) NOT NULL, |
||
53 | TRX_TYPE VARCHAR(5), |
||
54 | SHOPPER_REF_NO INTEGER, |
||
55 | CURRENCY VARCHAR(3), |
||
56 | CHARGE_AMT DECIMAL(15,2), |
||
57 | ATOME_ID VARCHAR(15), |
||
58 | TRAN_ID VARCHAR(20), |
||
59 | STATUS VARCHAR(2), |
||
60 | IS_VALID CHARACTER DEFAULT 'N', |
||
61 | PAY_DATE TIMESTAMP, |
||
62 | CREATE_DATETIME TIMESTAMP DEFAULT CURRENT TIMESTAMP, |
||
63 | MODIFY_DATETIME TIMESTAMP, |
||
64 | PRIMARY KEY (ORDER_ID)); |
||
65 | </pre> |
||
66 | |||
67 | h2. Atome Service |
||
68 | |||
69 | <pre> |
||
70 | com.atome.service.AtomeService service = new com.atome.service.AtomeService(); |
||
71 | </pre> |
||
72 | |||
73 | h3. getURL |
||
74 | |||
75 | <pre> |
||
76 | 6 | Soh Keong | AtomeResponseBean responseBean = service.getURL(Connection conn, AtomeRequestBean payment); |
77 | 2 | Soh Keong | </pre> |
78 | |||
79 | # *conn* - Database connection. |
||
80 | # *payment* - AtomeRequestBean object. |
||
81 | 1 | Soh Keong | > * *orderId* - Order ID. |
82 | 6 | Soh Keong | > * *trxType* - |
83 | 10 | Soh Keong | > * *currency* - com.atome.common.CommonConstant.CURRENCY_* (Currency MUST SET before Amount) |
84 | 2 | Soh Keong | > * *amount* - Transaction amount. |
85 | > * *shopperRefNo* - |
||
86 | 3 | Soh Keong | > * *callbackUrl* - Backend response. |
87 | 2 | Soh Keong | > * *paymentResultUrl* - |
88 | > * *paymentCancelUrl* - |
||
89 | 5 | Soh Keong | -> * *expirationTimeInSeconds* - int- |
90 | 4 | Soh Keong | -> * *customerInfo* - object CustomerInfoBean- |
91 | ->> * *mobileNumber* -- |
||
92 | -> * *shippingAddress* - object ShippingAddressBean- |
||
93 | ->> * *countryCode* - com.atome.common.CommonConstant.ADDRESS_COUNTRY_*- |
||
94 | ->> * *lines* - Address line- |
||
95 | ->> * *postcode* -- |
||
96 | -> * *productList* - Array- |
||
97 | ->> * *productId* -- |
||
98 | ->> * *productName* -- |
||
99 | ->> * *quantity* - int- |
||
100 | 1 | Soh Keong | ->> * *price* - double- |
101 | 6 | Soh Keong | |
102 | # *responseBean* |
||
103 | > *status* - |
||
104 | > *redirectUrl* - |
||
105 | > *appPaymentUrl* - |
||
106 | > *qrCodeUrl* - |
||
107 | 2 | Soh Keong | |
108 | h3. Update transaction |
||
109 | 1 | Soh Keong | |
110 | <pre> |
||
111 | AtomeResponseBean responseBean = service.updateTransaction(Connection conn, HttpServletRequest request); |
||
112 | </pre> |
||
113 | |||
114 | # *responseBean* |
||
115 | 3 | Soh Keong | > * orderId - |
116 | > * trxType - |
||
117 | > * status - |
||
118 | > * valid - |
||
119 | > * httpCode - |
||
120 | > * httpMessage - |