Package de.hybris.platform.returns
Interface ReturnService
- All Known Implementing Classes:
DefaultReturnService,WarehousingReturnService
public interface ReturnService
Service for handling 'Order Returns'. It offers ...
- Configurable "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) handling
- Replacement Order handling
- Refund handling incl. calculation
- Configurable 'is returnable' check
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddReplacementOrderEntries(ReplacementOrderModel order, List<ReplacementEntryModel> replacements) AddsReplacementOrderEntryModelentries from the specifiedReplacementEntryModel.createRefund(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, RefundReason reason) Creates a Refund based on the assigned OrderEntry instancecreateReplacement(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, ReplacementReason reason) Creates a Replacement based on the assigned OrderEntry instancecreateReplacementOrder(ReturnRequestModel request) Creates aReplacementOrderModelcreateReturnRequest(OrderModel order) Creates an "return request" object (@link ReturnRequest} for the order to be returned.createRMA(ReturnRequestModel request) creates "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) and assigns it to the assignedReturnRequestModelReturns all returnableOrderEntry'sGets order return record for a given order.Returns theReplacementOrderModelby the specified 'RMA value'getReplacements(ReturnRequestModel request) Returns all Replacements for the specified return requestgetReturnEntries(ProductModel product) Returns the ReturnEntries for the specified productReturns the ReturnEntries for the specified order entrygetReturnRequests(String orderCode) Returns the "return request" for the specified ordergetRMA(ReturnRequestModel request) returns a "Return Merchandise Authorization" aka "Return Material Authorization" (RMA).booleanisReturnable(OrderModel order, AbstractOrderEntryModel entry, long returnQuantity) Determines if the product is 'returnable' by using the injectedReturnableCheckimpl.default longmaxReturnQuantity(OrderModel order, AbstractOrderEntryModel entry) Determines the max returnable quantity of the product by using the injectedReturnableCheckimpl.voidprocessRefundOrder(OrderModel order) Here you have the chance to 'inject' your final Refund order processing.voidHere you have the chance to 'inject' your final Replacement order processing.voidprocessReturnEntries(List<ReturnEntryModel> entries) Here you have the chance to 'inject' your final Return Entry processing.voidrequestManualPaymentReversalForReturnRequest(ReturnRequestModel returnRequest) Request manual payment reversal for the (@link ReturnRequest}.voidrequestManualTaxReversalForReturnRequest(ReturnRequestModel returnRequest) Request manual tax reversal for the (@link ReturnRequest}.
-
Method Details
-
createReturnRequest
Creates an "return request" object (@link ReturnRequest} for the order to be returned.- Parameters:
order- the order which should be returned- Returns:
- ReturnRequest instance, which contains among others the RMA code.
-
getReturnRequests
Returns the "return request" for the specified order- Parameters:
orderCode- code of the order we ask for the "return request"- Returns:
- "return request" of the order
-
getRMA
returns a "Return Merchandise Authorization" aka "Return Material Authorization" (RMA).- Parameters:
request- reference of the related ReturnRequest- Returns:
- Return Merchandise Authorization code
-
createRMA
creates "Return Merchandise Authorization" aka "Return Material Authorization" (RMA) and assigns it to the assignedReturnRequestModel- Parameters:
request- reference of the related "ReturnRequest" for which this RMA will be created- Returns:
- Return Merchandise Authorization code
-
getReplacementOrder
Returns theReplacementOrderModelby the specified 'RMA value'- Parameters:
rma- rma value- Returns:
- replacement order
-
createReplacementOrder
Creates aReplacementOrderModel- Parameters:
request- the return request to which the order will be assigned- Returns:
- the Replacement Order'
-
addReplacementOrderEntries
void addReplacementOrderEntries(ReplacementOrderModel order, List<ReplacementEntryModel> replacements) AddsReplacementOrderEntryModelentries from the specifiedReplacementEntryModel.- Parameters:
order- the replacement orderreplacements- the 'replacement' entries (instances which are on HOLD will be ignored)
-
createReplacement
ReplacementEntryModel createReplacement(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, ReplacementReason reason) Creates a Replacement based on the assigned OrderEntry instance- Parameters:
request- we use this for the verification process (order)entry- the original OrderEntrynotes- some notesexpectedQuantity- the amount of products which the customer wants to return.action- action which indicates if the 'returns process' will be executed immediately or is still on hold (waiting for the article to be send back)reason- reason for the replacement- Returns:
- Replacement Entry instance
-
createRefund
RefundEntryModel createRefund(ReturnRequestModel request, AbstractOrderEntryModel entry, String notes, Long expectedQuantity, ReturnAction action, RefundReason reason) Creates a Refund based on the assigned OrderEntry instance- Parameters:
request- we use this for the verification process (order)entry- the original OrderEntrynotes- some notesexpectedQuantity- the amount of products which the customer wants to refund.action- action which indicates if the 'return process' will be executed immediately or is still on hold (waiting for the article to be send back)reason- reason for the refund- Returns:
- Refund entry instance
-
getReturnEntries
Returns the ReturnEntries for the specified product- Parameters:
product- the product- Returns:
- the Return entry instance
-
getReturnEntry
Returns the ReturnEntries for the specified order entry- Parameters:
entry- the OrderEntry- Returns:
- the return entry instance
-
getReplacements
Returns all Replacements for the specified return request- Parameters:
request- the ReturnRequestModel- Returns:
- the replacements
-
isReturnable
Determines if the product is 'returnable' by using the injectedReturnableCheckimpl.- Parameters:
order- the related original orderentry- the ordered product which will be returnedreturnQuantity- the quantity of entries to be returned- Returns:
- true if product is 'returnable'
-
maxReturnQuantity
Determines the max returnable quantity of the product by using the injectedReturnableCheckimpl.- Parameters:
order- the related original orderentry- the ordered product which will be returned- Returns:
- max returnable quantity of the product
-
processReturnEntries
Here you have the chance to 'inject' your final Return Entry processing. For example for handling consignment creation- Parameters:
entries- the entries to be processed
-
processReplacementOrder
Here you have the chance to 'inject' your final Replacement order processing. For example for handling consignment creation- Parameters:
order- the order to be processed
-
processRefundOrder
Here you have the chance to 'inject' your final Refund order processing. For example for handling consignment creation or initiating the final payment transaction.- Parameters:
order- the order to be processed
-
getAllReturnableEntries
Returns all returnableOrderEntry's- Parameters:
order- the related order- Returns:
- all returnable
OrderEntryand their returnable quantity
-
getOrderReturnRecordForOrder
Gets order return record for a given order.- Parameters:
order- instance ofOrderModelto get the return record for- Returns:
- order return record for the given order
- Throws:
OrderReturnException- in the case of error during service call
-
requestManualPaymentReversalForReturnRequest
void requestManualPaymentReversalForReturnRequest(ReturnRequestModel returnRequest) throws OrderReturnException Request manual payment reversal for the (@link ReturnRequest}.- Parameters:
returnRequest- the return request for which payment should be manually reversed- Throws:
OrderReturnException- in the case of error during service call
-
requestManualTaxReversalForReturnRequest
void requestManualTaxReversalForReturnRequest(ReturnRequestModel returnRequest) throws OrderReturnException Request manual tax reversal for the (@link ReturnRequest}.- Parameters:
returnRequest- the return request for which tax should be manually reversed- Throws:
OrderReturnException- in the case of error during service call
-