public class SignatureGenerator
extends java.lang.Object
The signature is created from the following values and then signed with
Secret Key
host - Sandbox
(apitest.cybersource.com) or Production
(api.cybersource.com) hostname
date - HTTP-date with format as defined by RFC7231
request-target - Should be in format of httpMethod: path
Example : post /pts/v2/payments
Digest - Only needed for POST calls
v-c-merchant-id - Cybersource Merchant ID found on EBC portal
| Constructor and Description |
|---|
SignatureGenerator(MerchantConfig merchantConfig) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getRequestTarget(java.lang.String requestType) |
java.lang.String |
signatureGeneration() |
public SignatureGenerator(MerchantConfig merchantConfig) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, ConfigException
merchantConfig-contains - all information of merchant.java.security.InvalidKeyException - - if key is not valid.java.security.NoSuchAlgorithmException - - if algorithm is not available.ConfigExceptionpublic java.lang.String signatureGeneration()
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException - - if algorithm is not available.java.security.InvalidKeyException - - if key is not valid.public java.lang.String getRequestTarget(java.lang.String requestType)
requestType - - GET/PUT/POST/PATCH/DELETECopyright © 2023. All Rights Reserved.