Interface RequestResponseTransformer

All Known Implementing Classes:
AbstractRequestResponseTransformer, MyFatoorahAuthorizeAndCaptureRequestResponseTransformer, MyFatoorahAuthorizeRequestResponseTransformer, MyFatoorahCaptureRequestResponseTransformer, MyFatoorahRefundRequestResponseTransformer, MyFatoorahReverseAuthorizeRequestResponseTransformer

public interface RequestResponseTransformer
The transformer is used to create the request body for the MyFatoorah requests and populate the payment response.
Author:
Dima Myroniuk (dmyroniuk)
  • Method Details

    • canHandle

      boolean canHandle(String transactionType)
      Checks if this transformer can handle the specified transaction type.
      Parameters:
      transactionType - the transaction type of the request
      Returns:
      true if this transformer can be used for the specified request
    • createMyFatoorahRequest

      Map<String,Object> createMyFatoorahRequest(MyFatoorahPaymentRequest myFatoorahPaymentRequest)
      Creates the MyFatoorah request body based on MyFatoorahPaymentRequest.
      Parameters:
      myFatoorahPaymentRequest - the myFatoorah payment request
      Returns:
      the MyFatoorah request body
      Throws:
      MyFatoorahRequestCreationException - when a problem is encountered while creating a MyFatoorah API request based on the provided MyFatoorahPaymentRequest
    • populatePaymentResponse

      com.broadleafcommerce.paymentgateway.domain.PaymentResponse populatePaymentResponse(MyFatoorahPaymentRequest myFatoorahPaymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, MyFatoorahResponse myFatoorahResponse)
      Populates the payment response based on the response from the MyFatoorah API.
      Parameters:
      myFatoorahPaymentRequest - the myFatoorah payment request
      paymentResponse - the payment response to populate
      myFatoorahResponse - the response from MyFatoorah API
      Returns:
      the populated payment response
      Throws:
      MyFatoorahResponseInterpretationException - when a problem is encountered while converting a MyFatoorah API response into a PaymentResponse