API References » History » Version 6
chin-yeh, 10/31/2011 11:28 AM
1 | 1 | chin-yeh | {{toc}} |
---|---|---|---|
2 | |||
3 | h1. API References |
||
4 | 2 | chin-yeh | |
5 | This is the list of API references for all of the integrated SP web services. |
||
6 | |||
7 | h2. Query utilization status of the Special Bundle Set |
||
8 | |||
9 | 3 | chin-yeh | This API queries whether the special bundle set has been utilized. |
10 | |||
11 | _Method Signature:_ |
||
12 | <pre> |
||
13 | <code class="JAVA"> |
||
14 | 6 | chin-yeh | public static boolean isUtilized(String memberId, String countryCode) |
15 | throws RemoteException |
||
16 | 4 | chin-yeh | </code> |
17 | 3 | chin-yeh | </pre> |
18 | |||
19 | 2 | chin-yeh | h3. Input Parameters |
20 | |||
21 | 3 | chin-yeh | * _memberId_ - the shopper/member ID |
22 | * _countryCode_ - the country code of the member |
||
23 | |||
24 | h3. Output Parameters |
||
25 | 1 | chin-yeh | |
26 | 6 | chin-yeh | *true* means utlized |
27 | 3 | chin-yeh | |
28 | |||
29 | 2 | chin-yeh | h3. Code Snippets |
30 | |||
31 | 1 | chin-yeh | <pre> |
32 | 4 | chin-yeh | <code class="JAVA"> |
33 | String memberId = request.getParameter("member_id"); |
||
34 | String countryCode = request.getParameter("country_code"); |
||
35 | |||
36 | 6 | chin-yeh | TransactionResponse result = SpServicesUtils.isUtilized(memberId, countryCode); |
37 | 4 | chin-yeh | </code> |
38 | </pre> |
||
39 | |||
40 | 2 | chin-yeh | h2. Utilize the Special Bundle Set |
41 | |||
42 | 5 | chin-yeh | Flag the Special Bundle Set as utilized for the given member/shopper ID. |
43 | |||
44 | _Method Signature:_ |
||
45 | <pre> |
||
46 | <code class="JAVA"> |
||
47 | public static TransactionResponse flagSpecialSetUtilization( |
||
48 | Connection dbConnection, String orderId, |
||
49 | String countryCode, String memberId, Date trxDate) |
||
50 | throws RemoteException, SQLException { |
||
51 | </code> |
||
52 | </pre> |
||
53 | |||
54 | 2 | chin-yeh | h3. Input Parameters |
55 | |||
56 | 5 | chin-yeh | * _dbConnection_ - an established database connection |
57 | * _orderId_ - the order ID |
||
58 | * _countryCode_ - the country code of the member |
||
59 | * _memberId_ - the shopper/member ID |
||
60 | * _trxDate_ - the transaction date |
||
61 | |||
62 | 2 | chin-yeh | h3. Output Parameters |
63 | 1 | chin-yeh | |
64 | 4 | chin-yeh | The returned object, *TransactionResponse* consists of: |
65 | * _process_ - the process code of the submitted request |
||
66 | * _trxId_ - the submitted transaction ID, a.k.a. order ID |
||
67 | * _centerId_ - either _ONLINE_ or _TEST_ |
||
68 | * _memberId_ - the member/shopper ID |
||
69 | * _status_ - the [[wiki#ErrorCode-References|status code]], e.g. 0000 |
||
70 | * _errCode_ - the [[wiki#ErrorCode-References|error code]], e.g. 00000 |
||
71 | * _errMessage_ - the detailed description of the status code |
||
72 | * _isUtilized_ - true if utilized else false |
||
73 | |||
74 | 2 | chin-yeh | h3. Code Snippets |
75 | 1 | chin-yeh | |
76 | 4 | chin-yeh | <pre> |
77 | <code class="JAVA"> |
||
78 | String memberId = request.getParameter("member_id"); |
||
79 | String countryCode = request.getParameter("country_code"); |
||
80 | String orderId = request.getParameter("order_id"); |
||
81 | Date transactionDate = new Date(); |
||
82 | |||
83 | Connection dbConnection = DBConnectionFactory.createDbConnection("java:/DB2DS_USA"); |
||
84 | |||
85 | TransactionResponse result = null; |
||
86 | try { |
||
87 | result = SpServicesUtils.flagSpecialSetUtilization(dbConnection, |
||
88 | orderId, countryCode, memberId, transactionDate); |
||
89 | } finally { |
||
90 | if (dbConnection != null) { |
||
91 | dbConnection.close(); |
||
92 | } |
||
93 | } |
||
94 | </code> |
||
95 | </pre> |
||
96 | |||
97 | 2 | chin-yeh | h2. Return the Special Bundle Set |
98 | |||
99 | 5 | chin-yeh | Inform SP to flag the status as un-utilized when return or exchange the Special Bundle Set. |
100 | |||
101 | _Method Signature:_ |
||
102 | <pre> |
||
103 | <code class="JAVA"> |
||
104 | public static TransactionResponse unflagSpecialSetUtilization( |
||
105 | Connection dbConnection, |
||
106 | String orderId, String countryCode, String memberId, Date trxDate) |
||
107 | throws RemoteException, SQLException { |
||
108 | </code> |
||
109 | </pre> |
||
110 | |||
111 | 2 | chin-yeh | h3. Input Parameters |
112 | 5 | chin-yeh | |
113 | * _dbConnection_ - an established database connection |
||
114 | * _orderId_ - the order ID |
||
115 | * _countryCode_ - the country code of the member |
||
116 | * _memberId_ - the shopper/member ID |
||
117 | * _trxDate_ - the transaction date |
||
118 | 2 | chin-yeh | |
119 | h3. Output Parameters |
||
120 | 1 | chin-yeh | |
121 | 4 | chin-yeh | The returned object, *TransactionResponse* consists of: |
122 | * _process_ - the process code of the submitted request |
||
123 | * _trxId_ - the submitted transaction ID, a.k.a. order ID |
||
124 | * _centerId_ - either _ONLINE_ or _TEST_ |
||
125 | * _memberId_ - the member/shopper ID |
||
126 | * _status_ - the [[wiki#ErrorCode-References|status code]], e.g. 0000 |
||
127 | * _errCode_ - the [[wiki#ErrorCode-References|error code]], e.g. 00000 |
||
128 | * _errMessage_ - the detailed description of the status code |
||
129 | * _isUtilized_ - true if utilized else false |
||
130 | |||
131 | 1 | chin-yeh | h3. Code Snippets |
132 | 4 | chin-yeh | |
133 | <pre> |
||
134 | <code class="JAVA"> |
||
135 | String memberId = request.getParameter("member_id"); |
||
136 | String countryCode = request.getParameter("country_code"); |
||
137 | String orderId = request.getParameter("order_id"); |
||
138 | Date transactionDate = new Date(); |
||
139 | |||
140 | Connection dbConnection = DBConnectionFactory.createDbConnection("java:/DB2DS_USA"); |
||
141 | |||
142 | TransactionResponse result = null; |
||
143 | try { |
||
144 | result = SpServicesUtils.unflagSpecialSetUtilization(dbConnection, |
||
145 | orderId, countryCode, memberId, transactionDate); |
||
146 | } finally { |
||
147 | if (dbConnection != null) { |
||
148 | dbConnection.close(); |
||
149 | } |
||
150 | } |
||
151 | </code> |
||
152 | </pre> |