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)
-
Field Summary
Fields inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
failureCount, isUp
-
Constructor Summary
ConstructorDescriptionDefaultMyFatoorahExternalCallService
(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, MyFatoorahProvider myFatoorahProvider, List<RequestResponseTransformer> requestResponseTransformers, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalMyFatoorahProviderProperties properties, MyFatoorahConfigurationProperties myFatoorahConfigurationProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
buildPaymentResponse
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
call
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) Executes the payment request to the MyFatoorah API.com.broadleafcommerce.paymentgateway.domain.PaymentResponse
communicateWithVendor
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) protected MyFatoorahResponse
convertFromErrorJson
(@NonNull org.springframework.web.reactive.function.client.WebClientResponseException receivedException, @NonNull String transactionReferenceId) protected MyFatoorahResponse
executeRequest
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) protected String
getGatewayTransactionType
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) protected String
getInvoiceId
(@NonNull MyFatoorahResponse myFatoorahResponse) protected com.fasterxml.jackson.databind.ObjectMapper
protected MyFatoorahConfigurationProperties
protected MyFatoorahProvider
protected String
getPaymentIdFromUrl
(@NonNull String url, @NonNull String paramName) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil
protected String
getPaymentUrl
(@NonNull MyFatoorahResponse myFatoorahResponse) protected ExternalMyFatoorahProviderProperties
protected String
getRefundId
(@NonNull MyFatoorahResponse refundResponse) protected String
getRefundReference
(@NonNull MyFatoorahResponse refundResponse) protected List<RequestResponseTransformer>
protected com.broadleafcommerce.common.extension.TypeFactory
protected MyFatoorahResponse
handleExecuteCustomRequest
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) protected MyFatoorahResponse.InvoiceTransaction
identifyLatestTransaction
(@NonNull MyFatoorahResponse myFatoorahResponse) protected RequestResponseTransformer
identifyRequestResponseTransformer
(@NonNull String transactionType) protected boolean
isInvoiceStatusInProgress
(@NonNull MyFatoorahResponse response) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
processProviderApiException
(@NonNull ProviderApiException apiException, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) protected boolean
requires3DSVerification
(@NonNull MyFatoorahResponse response) Methods inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
clearStatus, getServiceStatus, incrementFailure, process
-
Constructor Details
-
DefaultMyFatoorahExternalCallService
public DefaultMyFatoorahExternalCallService(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil, MyFatoorahProvider myFatoorahProvider, List<RequestResponseTransformer> requestResponseTransformers, com.fasterxml.jackson.databind.ObjectMapper mapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalMyFatoorahProviderProperties properties, MyFatoorahConfigurationProperties myFatoorahConfigurationProperties)
-
-
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 interfaceMyFatoorahExternalCallService
- Parameters:
myFatoorahPaymentRequest
- the payment request that should be executed for the specifiedtransaction type
.- Returns:
- the payment response
-
getServiceName
- Specified by:
getServiceName
in interfacecom.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<MyFatoorahPaymentRequest>
-
communicateWithVendor
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse communicateWithVendor(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) - Specified by:
communicateWithVendor
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<MyFatoorahPaymentRequest,
com.broadleafcommerce.paymentgateway.domain.PaymentResponse>
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThreshold
in interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable
- Specified by:
getFailureReportingThreshold
in classcom.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
-
getRefundReference
-
getInvoiceId
-
getPaymentUrl
-
isInvoiceStatusInProgress
-
requires3DSVerification
-
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
-
getPaymentResponseUtil
protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil() -
getMyFatoorahProvider
-
getRequestResponseTransformers
-
getMapper
protected com.fasterxml.jackson.databind.ObjectMapper getMapper() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getProperties
-
getMyFatoorahConfigurationProperties
-