Class MyFatoorahRefundRequestResponseTransformer
java.lang.Object
com.broadleafcommerce.myfatoorah.service.requestresponse.AbstractRequestResponseTransformer
com.broadleafcommerce.myfatoorah.service.requestresponse.MyFatoorahRefundRequestResponseTransformer
- All Implemented Interfaces:
RequestResponseTransformer
The transformer for
DefaultTransactionTypes.REFUND
transaction type.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorDescriptionMyFatoorahRefundRequestResponseTransformer
(MyFatoorahConfigurationProperties configProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if this transformer can handle the specified transaction type.createMyFatoorahRequest
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) Creates the MyFatoorah request body based onMyFatoorahPaymentRequest
.protected boolean
getRefundChargeOnCustomer
(@NonNull MyFatoorahPaymentRequest paymentRequest) protected String
getRefundTransactionTotal
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected boolean
getServiceChargeOnCustomer
(@NonNull MyFatoorahPaymentRequest paymentRequest) identifyLatestRefund
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull MyFatoorahResponse myFatoorahResponse) boolean
isRefunded
(MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult) protected boolean
com.broadleafcommerce.paymentgateway.domain.PaymentResponse
populatePaymentResponse
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull MyFatoorahResponse myFatoorahResponse) Populates the payment response based on the response from the MyFatoorah API.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
populatePaymentResponse
(@NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull MyFatoorahResponse myFatoorahResponse, MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult) protected void
populateResponseMap
(MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) Methods inherited from class com.broadleafcommerce.myfatoorah.service.requestresponse.AbstractRequestResponseTransformer
getConfigProperties, getCurrencyCode, getGatewayResponseCode, getInvoiceAmount, getObjectMapper, getTransactionAmount, identifyFailureType, identifyLatestTransaction, putIfNotBlank
-
Constructor Details
-
MyFatoorahRefundRequestResponseTransformer
public MyFatoorahRefundRequestResponseTransformer(MyFatoorahConfigurationProperties configProperties, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
canHandle
Description copied from interface:RequestResponseTransformer
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
public Map<String,Object> createMyFatoorahRequest(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest) Description copied from interface:RequestResponseTransformer
Creates the MyFatoorah request body based onMyFatoorahPaymentRequest
.- Specified by:
createMyFatoorahRequest
in interfaceRequestResponseTransformer
- Overrides:
createMyFatoorahRequest
in classAbstractRequestResponseTransformer
- Parameters:
myFatoorahPaymentRequest
- the myFatoorah payment request- Returns:
- the MyFatoorah request body
-
populatePaymentResponse
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse populatePaymentResponse(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull MyFatoorahResponse myFatoorahResponse) Description copied from interface:RequestResponseTransformer
Populates the payment response based on the response from the MyFatoorah API.- Specified by:
populatePaymentResponse
in interfaceRequestResponseTransformer
- Overrides:
populatePaymentResponse
in classAbstractRequestResponseTransformer
- Parameters:
myFatoorahPaymentRequest
- the myFatoorah payment requestpaymentResponse
- the payment response to populatemyFatoorahResponse
- the response from MyFatoorah API- Returns:
- the populated payment response
-
getRefundChargeOnCustomer
protected boolean getRefundChargeOnCustomer(@NonNull @NonNull MyFatoorahPaymentRequest paymentRequest) -
getServiceChargeOnCustomer
protected boolean getServiceChargeOnCustomer(@NonNull @NonNull MyFatoorahPaymentRequest paymentRequest) -
getRefundTransactionTotal
protected String getRefundTransactionTotal(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
populatePaymentResponse
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse populatePaymentResponse(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull MyFatoorahResponse myFatoorahResponse, @NonNull MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult) -
identifyLatestRefund
protected MyFatoorahResponse.MyFatoorahRefundStatusResult identifyLatestRefund(@NonNull @NonNull MyFatoorahPaymentRequest myFatoorahPaymentRequest, @NonNull @NonNull MyFatoorahResponse myFatoorahResponse) -
isRefunded
-
populateResponseMap
protected void populateResponseMap(@NonNull MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) -
isRefundStatusPending
protected boolean isRefundStatusPending(@NonNull MyFatoorahResponse.MyFatoorahRefundStatusResult refundResult)
-