Interface AlipayService
- All Known Implementing Classes:
DefaultAlipayService
public interface AlipayService
Deals with alipay related request
-
Method Summary
Modifier and TypeMethodDescriptionCreates signaturedefault StringcreateLinkString(Map<String, String> params, String... charset) Encodes alipay link urldefault StringEncrypted by signature typegenerateUrl(Map<String, String> sParaTemp, AlipayConfiguration alipayConfig) Generates alipay urlparaFilter(Map<String, String> sArray) Filters signature parameterspostRequest(Map<String, String> sParaTemp, AlipayConfiguration alipayConfig) Simulates the http post request, uses this method to generate the XML response from alipay
-
Method Details
-
generateUrl
String generateUrl(Map<String, String> sParaTemp, AlipayConfiguration alipayConfig) throws UnsupportedEncodingExceptionGenerates alipay url- Parameters:
sParaTemp- parameters for generating urlalipayConfig- alipay configuration- Returns:
- alipay url
- Throws:
UnsupportedEncodingException- throw UnsupportedEncodingException when parameters contain unsupported encoding chars
-
postRequest
Simulates the http post request, uses this method to generate the XML response from alipay- Parameters:
sParaTemp- request parametersalipayConfig- alipay configuration- Returns:
- XML response from alipay
-
paraFilter
Filters signature parameters- Parameters:
sArray- the request parameters- Returns:
- filtered parameters
-
buildMysign
Creates signature- Parameters:
sArray- the request parameterskey- private keysignType- signature type- Returns:
- signature
-
encrypt
Encrypted by signature type- Parameters:
signType- signature typepreStr- original string- Returns:
- encrypted string
-
createLinkString
default String createLinkString(Map<String, String> params, String... charset) throws UnsupportedEncodingExceptionEncodes alipay link url- Parameters:
params- the parameters used for encoding urlcharset- the charset used for encoding url- Returns:
- encoded url
- Throws:
UnsupportedEncodingException- throw UnsupportedEncodingException when parameters contain unsupported encoding chars
-