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 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 interface ResponseTransformer
      Parameters:
      braintreePaymentRequest - the Braintree payment request
      paymentResponse - the payment response to populate
      braintreeResponse - the response from Braintree API
      Returns:
      the populated payment response
    • getTransactionAmount

      @Nullable protected javax.money.MonetaryAmount getTransactionAmount(@NonNull BraintreeResponse.Transaction transaction)
    • identifyFailureType

      protected String identifyFailureType(String errorClass, String transactionReferenceId)
    • getMessage

      protected String getMessage(BraintreeResponse braintreeResponse)
    • putIfNotBlank

      protected void putIfNotBlank(@NonNull @NonNull Map<String,String> map, @NonNull @NonNull String key, @Nullable String value)
    • getConfigProperties

      protected BraintreeConfigurationProperties getConfigProperties()
    • getObjectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()