Class DefaultMyFatoorahExternalCallService

java.lang.Object
com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<MyFatoorahPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
com.broadleafcommerce.myfatoorah.service.DefaultMyFatoorahExternalCallService
All Implemented Interfaces:
MyFatoorahExternalCallService, com.broadleafcommerce.paymentgateway.service.FailureCountExposable, com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<MyFatoorahPaymentRequest>

public class DefaultMyFatoorahExternalCallService extends com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<MyFatoorahPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse> implements MyFatoorahExternalCallService
The default implementation for MyFatoorahExternalCallService.
Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

  • Method Details

    • call

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse call(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
      Description copied from interface: MyFatoorahExternalCallService
      Executes the payment request to the MyFatoorah API.
      Specified by:
      call in interface MyFatoorahExternalCallService
      Parameters:
      myFatoorahPaymentRequest - the payment request that should be executed for the specified transaction type.
      Returns:
      the payment response
    • getServiceName

      public String getServiceName()
      Specified by:
      getServiceName in interface com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<MyFatoorahPaymentRequest>
    • communicateWithVendor

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithVendor(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
      Specified by:
      communicateWithVendor in class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<MyFatoorahPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
    • getFailureReportingThreshold

      public Integer getFailureReportingThreshold()
      Specified by:
      getFailureReportingThreshold in interface com.broadleafcommerce.paymentgateway.service.FailureCountExposable
      Specified by:
      getFailureReportingThreshold in class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<MyFatoorahPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
    • buildPaymentResponse

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse buildPaymentResponse(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
    • getGatewayTransactionType

      protected String getGatewayTransactionType(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
    • identifyRequestResponseTransformer

      protected RequestResponseTransformer identifyRequestResponseTransformer(@NonNull @NonNull String transactionType)
    • executeRequest

      protected MyFatoorahResponse executeRequest(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
    • getRefundId

      @Nullable protected String getRefundId(@NonNull @NonNull MyFatoorahResponse refundResponse)
    • getRefundReference

      @Nullable protected String getRefundReference(@NonNull @NonNull MyFatoorahResponse refundResponse)
    • getInvoiceId

      @Nullable protected String getInvoiceId(@NonNull @NonNull MyFatoorahResponse myFatoorahResponse)
    • getPaymentUrl

      @Nullable protected String getPaymentUrl(@NonNull @NonNull MyFatoorahResponse myFatoorahResponse)
    • isInvoiceStatusInProgress

      protected boolean isInvoiceStatusInProgress(@NonNull @NonNull MyFatoorahResponse response)
    • requires3DSVerification

      protected boolean requires3DSVerification(@NonNull @NonNull MyFatoorahResponse response)
    • identifyLatestTransaction

      protected MyFatoorahResponse.InvoiceTransaction identifyLatestTransaction(@NonNull @NonNull MyFatoorahResponse myFatoorahResponse)
    • processProviderApiException

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse processProviderApiException(@NonNull @NonNull ProviderApiException apiException, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse)
    • convertFromErrorJson

      protected MyFatoorahResponse convertFromErrorJson(@NonNull @NonNull org.springframework.web.reactive.function.client.WebClientResponseException receivedException, @NonNull @NonNull String transactionReferenceId)
    • handleExecuteCustomRequest

      protected MyFatoorahResponse handleExecuteCustomRequest(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest)
    • getPaymentIdFromUrl

      @Nullable protected String getPaymentIdFromUrl(@NonNull @NonNull String url, @NonNull @NonNull String paramName)
    • getPaymentResponseUtil

      protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil()
    • getMyFatoorahProvider

      protected MyFatoorahProvider getMyFatoorahProvider()
    • getRequestResponseTransformers

      protected List<RequestResponseTransformer> getRequestResponseTransformers()
    • getMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getProperties

      protected ExternalMyFatoorahProviderProperties getProperties()
    • getMyFatoorahConfigurationProperties

      protected MyFatoorahConfigurationProperties getMyFatoorahConfigurationProperties()