Programming Guide » History » Revision 6
« Previous |
Revision 6/21
(diff)
| Next »
chin-yeh, 08/25/2011 02:20 PM
- Table of contents
- Programming Guide
Programming Guide¶
There are number of APIs provided by DP. All of these APIs are wrapped and exposed through a client application, dp-client. Refer to the following sub sections for more information.
The Javadoc of dp-client:
The binary or source files of dp-client:
Demo application of dp-client:
Query DP balance¶
Queries the available DP balance.
Input Parameters¶
See queryBalance
Output Parameters¶
The return object, TransactionResponse consists of:- process - Sales1
- transactionId - the unique reference that passed in by the caller
- countryId - the country ID that passed in by the caller
- centerId - possible value is ONLINE. It's used to differentiate if the caller are from POS system or online mall.
- memberId - the member/shopper ID
- status - the status of the transaction. If success, returns 0000
- refer to DP Web Services for other possible status
- balance - the available DP balance
- errorCode - the error code of the transaction. if success, returns 00000
- refer to DP Web Services for other possible error code
- errorMessage - the detailed description of the error code
- refer to DP Web Services for other possible description
Code Snippet¶
TransactionResponse dpResponse; try { dpResponse = DPServicesUtils.queryBalance(countryCode, shopperId); } catch (RemoteException ex) { // do not ignore. either log the full stack trace or handle it LOGGER.error(ex); }
Impose Sales Lock¶
Imposes the Sales Lock on the particular member ID. This method is usually to be used conjunction with Commit Sales. Without sales lock, the Commit Sales won't succeed.
Input Parameters¶
See imposeSalesLock
Output Parameters¶
Code Snippet¶
Release Sales Lock¶
Input Parameters¶
Output Parameters¶
Code Snippet¶
Commit Sales¶
Input Parameters¶
Output Parameters¶
Code Snippet¶
Sales Return / Sales Exchange¶
Input Parameters¶
Output Parameters¶
Code Snippet¶
VIP Upgrade to BO¶
Input Parameters¶
Output Parameters¶
Code Snippet¶
Generate the redirect URL for VIP Details page¶
Input Parameters¶
See vipDetailsPage
Output Parameters¶
Code Snippet¶
Exception Handling Strategies¶
The APIs would throw the following exceptions:- RemoteException - if there's any issue in communicating with the DP
- SQLException - if there's any issue in persisting or updating the event
- unchecked exception - e.g. NullPointerException. This is more like a programming errors so do not catch it for whatever reasons.
- note: catch the Exception will catch both checked & unchecked exception
The above exceptions should never be ignored, at least, the full error stack trace should be logged.
Updated by chin-yeh over 13 years ago · 6 revisions