public class Pingback extends Base
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
ipAddress
IP address, usually _SERVER["REMOTE_ADDR"]
|
protected java.util.LinkedHashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
parameters
Pingback parameters, usually received from parsing _GET
|
int |
PINGBACK_TYPE_GOODWILL |
int |
PINGBACK_TYPE_NEGATIVE |
int |
PINGBACK_TYPE_REGULAR
Pingback types
|
int |
PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED |
int |
PINGBACK_TYPE_RISK_REVIEWED_DECLINED |
int |
PINGBACK_TYPE_RISK_UNDER_REVIEW |
int |
PINGBACK_TYPE_SUBSCRIPTION_CANCELLATION |
int |
PINGBACK_TYPE_SUBSCRIPTION_EXPIRED |
int |
PINGBACK_TYPE_SUBSCRIPTION_PAYMENT_FAILED |
API_CART, API_GOODS, API_VC, CHARGE_URL, CONTROLLER_PAYMENT_CART, CONTROLLER_PAYMENT_DIGITAL_GOODS, CONTROLLER_PAYMENT_VIRTUAL_CURRENCY, DEFAULT_SIGNATURE_VERSION, errors, SIGNATURE_VERSION_1, SIGNATURE_VERSION_2, SIGNATURE_VERSION_3, SUBS_URL| Constructor and Description |
|---|
Pingback(java.util.Map<java.lang.String,java.lang.String[]> parameters_,
java.lang.String ipAddress_) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
calculateSignature(java.util.LinkedHashMap<java.lang.String,java.util.ArrayList<java.lang.String>> params,
java.lang.String secret,
int version)
Build signature for the pingback received
|
java.util.ArrayList<java.lang.String> |
getParameter(java.lang.String key)
Get pingback parameter
|
java.lang.String |
getPingbackUniqueId()
Returns unique identifier of the pingback that can be used for checking
if the same pingback was already processed by your servers.
|
Product |
getProduct() |
java.lang.String |
getProductId()
Get product id
|
int |
getProductPeriodLength() |
java.lang.String |
getProductPeriodType() |
java.util.ArrayList<Product> |
getProducts() |
java.lang.String |
getReferenceId()
Get pingback parameter "ref"
|
java.lang.String |
getType()
Get pingback parameter "type"
|
java.lang.String |
getTypeVerbal()
Get verbal explanation of the informational pingback
|
java.lang.String |
getUserId()
Get pingback parameter "uid"
|
double |
getVirtualCurrencyAmount()
Get pingback parameter "currency"
|
boolean |
isCancelable()
Check whether product is cancelable
|
boolean |
isDeliverable()
Check whether product is deliverable
|
boolean |
isIpAddressValid() |
boolean |
isParametersValid() |
boolean |
isSignatureValid() |
boolean |
isUnderReview()
Check whether product is under review
|
boolean |
validate() |
boolean |
validate(boolean skipIpWhitelistCheck)
Check whether pingback is valid
|
appendToErrors, getApiType, getAppKey, getErrors, getErrorSummary, getProApiKey, getSecretKey, parseQuery, round, setApiType, setAppKey, setProApiKey, setSecretKeypublic final int PINGBACK_TYPE_REGULAR
public final int PINGBACK_TYPE_GOODWILL
public final int PINGBACK_TYPE_NEGATIVE
public final int PINGBACK_TYPE_RISK_UNDER_REVIEW
public final int PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED
public final int PINGBACK_TYPE_RISK_REVIEWED_DECLINED
public final int PINGBACK_TYPE_SUBSCRIPTION_CANCELLATION
public final int PINGBACK_TYPE_SUBSCRIPTION_EXPIRED
public final int PINGBACK_TYPE_SUBSCRIPTION_PAYMENT_FAILED
protected java.util.LinkedHashMap<java.lang.String,java.util.ArrayList<java.lang.String>> parameters
protected java.lang.String ipAddress
public Pingback(java.util.Map<java.lang.String,java.lang.String[]> parameters_,
java.lang.String ipAddress_)
parameters_ - array of parameters received by pingback processing script, e.g. _GETipAddress_ - IP address from where the pingback request originates, e.g. "127.0.0.1"public boolean validate(boolean skipIpWhitelistCheck)
throws java.io.UnsupportedEncodingException,
java.security.NoSuchAlgorithmException
skipIpWhitelistCheck - if IP whitelist check should be skipped, e.g. if you have a load-balancer changing the IPjava.io.UnsupportedEncodingException - md5 and sha256 calculation Digestjava.security.NoSuchAlgorithmException - md5 and sha256 calculation Digestpublic boolean validate()
throws java.io.UnsupportedEncodingException,
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingExceptionjava.security.NoSuchAlgorithmExceptionpublic boolean isSignatureValid()
throws java.io.UnsupportedEncodingException,
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException - md5 and sha256 calculation Digestjava.security.NoSuchAlgorithmException - md5 and sha256 calculation Digestpublic boolean isIpAddressValid()
public boolean isParametersValid()
public java.util.ArrayList<java.lang.String> getParameter(java.lang.String key)
key - links to element in params hashmap by keypublic java.lang.String getType()
public java.lang.String getTypeVerbal()
public java.lang.String getUserId()
public double getVirtualCurrencyAmount()
public java.lang.String getProductId()
public int getProductPeriodLength()
public java.lang.String getProductPeriodType()
public Product getProduct()
public java.util.ArrayList<Product> getProducts()
public java.lang.String getReferenceId()
public java.lang.String getPingbackUniqueId()
public boolean isDeliverable()
public boolean isCancelable()
public boolean isUnderReview()
protected java.lang.String calculateSignature(java.util.LinkedHashMap<java.lang.String,java.util.ArrayList<java.lang.String>> params,
java.lang.String secret,
int version)
params - represents parameters that are used for signature calculationsecret - Paymentwall Secret Keyversion - Paymentwall Signature VersionCopyright © 2015. All Rights Reserved.