Project

General

Profile

API References » History » Revision 4

Revision 3 (chin-yeh, 10/25/2011 05:00 PM) → Revision 4/7 (chin-yeh, 10/25/2011 05:04 PM)

{{toc}} 

 h1. API References 

 This is the list of API references for all of the integrated SP web services. 

 h2. Query utilization status of the Special Bundle Set 

 This API queries whether the special bundle set has been utilized. 

 _Method Signature:_ 
 <pre> 
 <code class="JAVA"> 
 public static TransactionResponse queryUtilizationStatus(String memberId,  
			 String countryCode) throws RemoteException 
 </code> </code. 
 </pre> 

 h3. Input Parameters 

 * _memberId_ - the shopper/member ID 
 * _countryCode_ - the country code of the member 

 h3. Output Parameters 

 The returned object, *TransactionResponse* consists of: 
 * _process_ - the process code of the submitted request 
 * _trxId_ - the submitted transaction ID, a.k.a. order ID 
 * _centerId_ - either _ONLINE_ or _TEST_ 
 * _memberId_ - the member/shopper ID 
 * _status_ - the [[wiki#ErrorCode-References|status code]], e.g. 0000 
 * _errCode_ - the [[wiki#ErrorCode-References|error code]], e.g. 00000 
 * _errMessage_ - the detailed description of the status code 
 * _isUtilized_ - true if utilized else false 


 h3. Code Snippets 

 <pre> 
 <code class="JAVA"> 
 String memberId = request.getParameter("member_id"); 
 String countryCode = request.getParameter("country_code"); 
	
 TransactionResponse result = SpServicesUtils.queryUtilizationStatus(memberId, countryCode); 
 </code> 
 </pre> 

 h2. Utilize the Special Bundle Set 

 h3. Input Parameters 

 h3. Output Parameters 

 The returned object, *TransactionResponse* consists of: 
 * _process_ - the process code of the submitted request 
 * _trxId_ - the submitted transaction ID, a.k.a. order ID 
 * _centerId_ - either _ONLINE_ or _TEST_ 
 * _memberId_ - the member/shopper ID 
 * _status_ - the [[wiki#ErrorCode-References|status code]], e.g. 0000 
 * _errCode_ - the [[wiki#ErrorCode-References|error code]], e.g. 00000 
 * _errMessage_ - the detailed description of the status code 
 * _isUtilized_ - true if utilized else false 

 h3. Code Snippets 

 <pre> 
 <code class="JAVA"> 
 String memberId = request.getParameter("member_id"); 
 String countryCode = request.getParameter("country_code"); 
 String orderId = request.getParameter("order_id"); 
 Date transactionDate = new Date(); 

 Connection dbConnection = DBConnectionFactory.createDbConnection("java:/DB2DS_USA"); 

 TransactionResponse result = null; 
 try { 
	 result = SpServicesUtils.flagSpecialSetUtilization(dbConnection, 
			 orderId, countryCode, memberId, transactionDate); 
 } finally { 
	 if (dbConnection != null) { 
		 dbConnection.close(); 
	 } 
 } 
 </code> 
 </pre> 

 h2. Return the Special Bundle Set 

 h3. Input Parameters 

 h3. Output Parameters 

 The returned object, *TransactionResponse* consists of: 
 * _process_ - the process code of the submitted request 
 * _trxId_ - the submitted transaction ID, a.k.a. order ID 
 * _centerId_ - either _ONLINE_ or _TEST_ 
 * _memberId_ - the member/shopper ID 
 * _status_ - the [[wiki#ErrorCode-References|status code]], e.g. 0000 
 * _errCode_ - the [[wiki#ErrorCode-References|error code]], e.g. 00000 
 * _errMessage_ - the detailed description of the status code 
 * _isUtilized_ - true if utilized else false 

 h3. Code Snippets 

 <pre> 
 <code class="JAVA"> 
 String memberId = request.getParameter("member_id"); 
 String countryCode = request.getParameter("country_code"); 
 String orderId = request.getParameter("order_id"); 
 Date transactionDate = new Date(); 

 Connection dbConnection = DBConnectionFactory.createDbConnection("java:/DB2DS_USA"); 

 TransactionResponse result = null; 
 try { 
	 result = SpServicesUtils.unflagSpecialSetUtilization(dbConnection, 
			 orderId, countryCode, memberId, transactionDate); 
 } finally { 
	 if (dbConnection != null) { 
		 dbConnection.close(); 
	 } 
 } 
 </code> 
 </pre>