Class AbstractBraintreeResponseTransformer
java.lang.Object
com.broadleafcommerce.braintree.service.requestresponse.AbstractBraintreeResponseTransformer
- All Implemented Interfaces:
ResponseTransformer
- Direct Known Subclasses:
BraintreeAuthorizeAndCaptureResponseTransformer
,BraintreeAuthorizeResponseTransformer
,BraintreeCaptureResponseTransformer
,BraintreeRefundResponseTransformer
,BraintreeReverseAuthorizeResponseTransformer
public abstract class AbstractBraintreeResponseTransformer
extends Object
implements ResponseTransformer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBraintreeResponseTransformer
(BraintreeConfigurationProperties configProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected BraintreeConfigurationProperties
protected String
getMessage
(BraintreeResponse braintreeResponse) protected com.fasterxml.jackson.databind.ObjectMapper
protected javax.money.MonetaryAmount
getTransactionAmount
(BraintreeResponse.Transaction transaction) protected String
identifyFailureType
(String errorClass, String transactionReferenceId) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
populatePaymentResponse
(@NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull BraintreeResponse braintreeResponse) Populates the payment response based on the response from the Braintree API.protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.braintree.service.requestresponse.ResponseTransformer
canHandle
-
Constructor Details
-
AbstractBraintreeResponseTransformer
protected AbstractBraintreeResponseTransformer(BraintreeConfigurationProperties configProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
populatePaymentResponse
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse populatePaymentResponse(@NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull BraintreeResponse braintreeResponse) Description copied from interface:ResponseTransformer
Populates the payment response based on the response from the Braintree API.- Specified by:
populatePaymentResponse
in interfaceResponseTransformer
- Parameters:
braintreePaymentRequest
- the Braintree payment requestpaymentResponse
- the payment response to populatebraintreeResponse
- the response from Braintree API- Returns:
- the populated payment response
-
getTransactionAmount
@Nullable protected javax.money.MonetaryAmount getTransactionAmount(@NonNull BraintreeResponse.Transaction transaction) -
identifyFailureType
-
getMessage
-
putIfNotBlank
-
getConfigProperties
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-