Project

General

Profile

API References » History » Revision 5

Revision 4 (chin-yeh, 10/25/2011 05:04 PM) → Revision 5/7 (chin-yeh, 10/25/2011 05:11 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> 
 </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 

 Flag the Special Bundle Set as utilized for the given member/shopper ID. 

 _Method Signature:_ 
 <pre> 
 <code class="JAVA"> 
 public static TransactionResponse flagSpecialSetUtilization( 
			 Connection dbConnection, String orderId, 
			 String countryCode, String memberId, Date trxDate)  
		 throws RemoteException, SQLException { 
 </code> 
 </pre> 

 h3. Input Parameters 

 * _dbConnection_ - an established database connection 
 * _orderId_ - the order ID 
 * _countryCode_ - the country code of the member 
 * _memberId_ - the shopper/member ID 
 * _trxDate_ - the transaction date 

 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 

 Inform SP to flag the status as un-utilized when return or exchange the Special Bundle Set. 

 _Method Signature:_ 
 <pre> 
 <code class="JAVA"> 
 public static TransactionResponse unflagSpecialSetUtilization( 
			 Connection dbConnection, 
			 String orderId, String countryCode, String memberId, Date trxDate)  
		 throws RemoteException, SQLException { 
 </code> 
 </pre> 

 h3. Input Parameters 

 * _dbConnection_ - an established database connection 
 * _orderId_ - the order ID 
 * _countryCode_ - the country code of the member 
 * _memberId_ - the shopper/member ID 
 * _trxDate_ - the transaction date 

 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>