Class AbstractAPSRequestResponseTransformer
java.lang.Object
com.broadleafcommerce.payment.service.gateway.requestresponse.AbstractAPSRequestResponseTransformer
- All Implemented Interfaces:
APSRequestResponseTransformer
- Direct Known Subclasses:
APSAuthorizeRequestResponseTransformer
,APSCaptureRequestResponseTransformer
,APSRefundRequestResponseTransformer
,APSReverseAuthorizeRequestResponseTransformer
public abstract class AbstractAPSRequestResponseTransformer
extends Object
implements APSRequestResponseTransformer
Default Request Response transform that transforms the PaymentRequest object to APS Compatible
request map and transforms APS Response map to BLC PaymentResponse object
- Author:
- Muhammad Salman Farooq
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAPSRequestResponseTransformer
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, APSConfigurationProperties configProperties) -
Method Summary
Modifier and TypeMethodDescriptioncreateAPSRequest
(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected javax.money.MonetaryAmount
getAmountInMajorUnits
(@NonNull Long amount, @NonNull String currencyCode) protected Long
getAmountInMinorUnits
(@NonNull javax.money.MonetaryAmount amount) protected APSConfigurationProperties
protected String
getMessageCode
(String responseCode) protected com.fasterxml.jackson.databind.ObjectMapper
protected String
identifyDeclineType
(Map<String, Object> apsResponse, String responseMessageCode, String applicationId, String tenantId) protected String
identifyFailureType
(Map<String, Object> apsResponse, String responseCode, String transactionReferenceId, String applicationId, String tenantId) protected boolean
protected boolean
isTransactionAwaitingAsyncResults
(String responseCode) Checks if the transaction has been processed, but failed to receive confirmation.com.broadleafcommerce.paymentgateway.domain.PaymentResponse
populatePaymentResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull APSPaymentRequest apsPaymentRequest, @NonNull Map<String, Object> apsResponse, String applicationId, String tenantId) MANDATORY SET OF FIELDS ON EVERY TRANSACTION *Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.payment.service.gateway.requestresponse.APSRequestResponseTransformer
canHandleTransactionType
-
Field Details
-
SUCCESS_MESSAGE_CODE
- See Also:
-
-
Constructor Details
-
AbstractAPSRequestResponseTransformer
public AbstractAPSRequestResponseTransformer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, APSConfigurationProperties configProperties)
-
-
Method Details
-
createAPSRequest
public Map<String,Object> createAPSRequest(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
createAPSRequest
in interfaceAPSRequestResponseTransformer
-
populatePaymentResponse
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse populatePaymentResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull APSPaymentRequest apsPaymentRequest, @NonNull @NonNull Map<String, Object> apsResponse, @Nullable String applicationId, @Nullable String tenantId) MANDATORY SET OF FIELDS ON EVERY TRANSACTION *- Specified by:
populatePaymentResponse
in interfaceAPSRequestResponseTransformer
-
isSuccess
-
identifyFailureType
-
isTransactionAwaitingAsyncResults
Checks if the transaction has been processed, but failed to receive confirmation. This happens when there is no response received or recorded back from the processors. There could be a delay or timeout happening. The response code in this case will be typically be 15777. Accordingly, Amazon Payment Services requires recovering this transaction and will eventually update to its final status, the recovery response of the payments will be pushed to notification URL in case of any outages happened on the processor level, the average response of receiving the recovery response within 30 minutes, the initial "response_code" received of the direct feedback URL is 15777, and the recovery will hold the final response of the payment.- Parameters:
responseCode
- the APS response code- Returns:
- true if the transaction has been processed, but failed to receive confirmation
-
identifyDeclineType
-
getMessageCode
-
getAmountInMinorUnits
-
getAmountInMajorUnits
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getConfigProperties
-