|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jambool.socialgold.api.PaymentsClient
public class PaymentsClient
PaymentsClient
Sample code to provide convient access to the Social Gold Payments V1 API methods that make a call to the service: - getBalance - getTransactionStatus - getTransaction - creditUser - debitUser - refundUser - buyGoods methods that generate a URL for merchant to render in a page: - getBuyPaymentsURL - getBuyGoodsURL Notes: - input validation is weak, if at all - JSON, XML, and other parsers are not included at this time - formal excetions should be thrown
Field Summary | |
---|---|
private String |
offerID
WRITEME: Document this brpocock@star-hope.org |
private String |
secretMerchantKey
WRITEME: Document this brpocock@star-hope.org |
private String |
serverName
WRITEME: Document this brpocock@star-hope.org |
Constructor Summary | |
---|---|
PaymentsClient(String newServerName,
String newOfferID,
String newSecretMerchantKey)
---------------------------------------------------------------- ------------- |
Method Summary | |
---|---|
private String |
_calculateSignature(Hashtable<?,?> signatureParams)
---------------------------------------------------------------- ------------- |
private Hashtable |
_getResponse(String cmdURL)
---------------------------------------------------------------- ------------- |
private Hashtable |
_getResponse(String cmdURL,
Boolean requiresSSL)
|
private String |
_getURL(Hashtable baseParams,
Hashtable requiredParams,
Hashtable optionalParams)
================================================================ ============= private methods below this ========================== =================================================== |
private String |
_getURL(Hashtable baseParams,
Hashtable requiredParams,
Hashtable optionalParams,
Boolean requiresSSL)
WRITEME: Document this method brpocock@star-hope.org |
private void |
_mergeParams(Hashtable srcParams,
Hashtable destParams)
---------------------------------------------------------------- ------------- |
private String |
_paramHashToURI(Hashtable params)
---------------------------------------------------------------- ------------- |
String |
getBuyCurrencyURL(String userID,
Float usdAmount,
String currency_label,
Integer currency_xrate,
Integer currency_amount,
Float quantity,
String format,
String app_params,
String platform)
WRITEME: Document this method brpocock@star-hope.org |
String |
getBuyGoodsURL(String userID,
Float usdAmount,
String title,
String format,
String external_ref_id,
Integer quantity,
String app_params,
String platform,
String platform_sub_id,
String statement_descriptor,
String sku)
============================================================ ============== buy_goods_with_socialgold returns a URL to have in your IFRAME SRC= tag WRITEME: Document this method brpocock@star-hope.org |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String offerID
private String secretMerchantKey
private String serverName
Constructor Detail |
---|
public PaymentsClient(String newServerName, String newOfferID, String newSecretMerchantKey)
newServerName
- WRITEMEnewOfferID
- WRITEMEnewSecretMerchantKey
- WRITEMEMethod Detail |
---|
public static void main(String[] args)
args
- command-line arguments (none needed)private String _calculateSignature(Hashtable<?,?> signatureParams)
signatureParams
- WRITEME
private Hashtable _getResponse(String cmdURL) throws org.apache.http.client.ClientProtocolException, IOException
cmdURL
- WRITEME
IOException
org.apache.http.client.ClientProtocolException
private Hashtable _getResponse(String cmdURL, Boolean requiresSSL) throws org.apache.http.client.ClientProtocolException, IOException
org.apache.http.client.ClientProtocolException
IOException
private String _getURL(Hashtable baseParams, Hashtable requiredParams, Hashtable optionalParams)
baseParams
- WRITEMErequiredParams
- WRITEMEoptionalParams
- WRITEME
private String _getURL(Hashtable baseParams, Hashtable requiredParams, Hashtable optionalParams, Boolean requiresSSL)
baseParams
- WRITEMErequiredParams
- WRITEMEoptionalParams
- WRITEMErequiresSSL
- WRITEME
private void _mergeParams(Hashtable srcParams, Hashtable destParams)
private String _paramHashToURI(Hashtable params)
public String getBuyCurrencyURL(String userID, Float usdAmount, String currency_label, Integer currency_xrate, Integer currency_amount, Float quantity, String format, String app_params, String platform)
userID
- WRITEMEusdAmount
- WRITEMEcurrency_label
- WRITEMEcurrency_xrate
- WRITEMEcurrency_amount
- WRITEMEquantity
- WRITEMEformat
- WRITEMEapp_params
- WRITEMEplatform
- WRITEME
public String getBuyGoodsURL(String userID, Float usdAmount, String title, String format, String external_ref_id, Integer quantity, String app_params, String platform, String platform_sub_id, String statement_descriptor, String sku)
userID
- the user_id of the player (e.g., "abc123")usdAmount
- amount in USD$ of the purchase (e.g., 1.75
implies $1.75)title
- description of item being soldformat
- ( iframe )external_ref_id
- a unique string with your representation
of the transactionquantity
- quantityapp_params
- a variable that will be passed back to you on
the post backplatform
- the platform of where this user is unique. Ifplatform_sub_id
- unique enum, representing the abovestatement_descriptor
- 8 character string - to be shown onsku
- unique string representing item in your system
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |