Class DefaultAPSExternalCallService

java.lang.Object
com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<APSPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
com.broadleafcommerce.payment.service.gateway.DefaultAPSExternalCallService
All Implemented Interfaces:
APSExternalCallService, com.broadleafcommerce.paymentgateway.service.FailureCountExposable, com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<APSPaymentRequest>

public class DefaultAPSExternalCallService extends com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<APSPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse> implements APSExternalCallService
This class communicates with APS Payfort APIs to perform transactions.
Author:
Muhammad Salman Farooq
  • Constructor Details

  • Method Details

    • call

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse call(@NonNull @NonNull APSPaymentRequest paymentRequest)
      Description copied from interface: APSExternalCallService
      Method to process and call the external gateway service. It delegates the request to communicateWithVendor method through abstraction.
      Specified by:
      call in interface APSExternalCallService
      Parameters:
      paymentRequest - The request payload that should be used to form the transaction
      Returns:
      PaymentResponse object that carries the response from the external gateway service
    • getServiceName

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

      public com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithVendor(APSPaymentRequest apsPaymentRequest)
      Specified by:
      communicateWithVendor in class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<APSPaymentRequest,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<APSPaymentRequest,com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
    • communicateWithAPI

      protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithAPI(APSPaymentRequest apsPaymentRequest)
      Method responsible for coordinating APS API calls (based on the provided APSPaymentRequest), and building a PaymentResponse, based on the API's response.
      Parameters:
      apsPaymentRequest - object which wraps the PaymentRequest object and holds the information about which transaction method among AUTHORIZE, CAPTURE, PURCHASE, REFUND AND VOID_AUTHORIZATION to be called
      Returns:
      PaymentResponse object that carries the response from the external gateway service
    • identifyAPSRequestResponseTransformer

      protected APSRequestResponseTransformer identifyAPSRequestResponseTransformer(APSTransactionType transactionType)
      Provider method that identifies which RequestResponse transformer to return based on the transaction type. Possible transaction types are :
      1. AUTHORIZE
      2. CAPTURE
      3. PURCHASE
      4. REFUND
      5. VOID_AUTHORIZATION
      Parameters:
      transactionType - The type of transaction used to identify a transformer
      Returns:
      The transformer object that corresponds to provided transaction type.
    • getConfiguration

      protected APSGatewayConfiguration getConfiguration()
    • getApsProvider

      protected APSProvider getApsProvider()
    • getRequestResponseTransformers

      protected List<APSRequestResponseTransformer> getRequestResponseTransformers()
    • getPaymentResponseUtil

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