Skip to main content

Commerce

Websphere Commerce: Returns and Refunds

Websphere commerce have Out of the box functionality of handling refunds on cancellation of an order and also returns. Here i am discussing technical details of handling returns and refunds of partial order, Like if you want to cancel only 2 items out of 50 items you ordered. Let’s say you have external Order management system tide up with websphere commerce, How can we handle returns and refunds.

This external system should communicate with services. Below are the steps one has to follow for accomplising this task.

  1. Lets determince the structure of the request. Websphere commerce provided order status service to communicate. Structure of order status can be found in Update_WCS_OrderStatus_30.dtd .
  2. Once we receive request XML that follows Update_WCS_OrderStatus_30 structure. WC will invoke command implementation for OrderStatusCmd.
  3. Create a custom implementation say XOrderStatusCmdImpl and update CMDREG accordingly, Ensure XOrderStatusCmdImpl extends OrderStatusCmdImpl.
  4. This setting will ensure order will sufficient for getting the request to the our controller.
  5. Few key points to remember is, Get refund policy id and refund payment method id
  6. We can get all the values from the request xml by calling  super.getOsProp(). This will give return TypeProperties.
  7. How can we map between XML and TypeProperties? That can be done by going through sys_template.xml
  8. Ensure order status is ‘X’. This is status for cancellation of order.
  9. Execute ReturnItemAddCmd
  10. Execute ReturnPrepareCmd. You can get Return item id from ReturnItemAddCmd (ex: returnItemAddCmd.getResponseProperties().getString(RMAItemId_0))
  11. If you want to update RMA items and RMA Item component use RMAItemAccessBean and RMAItemComponentAccessBean. I used RMAItemComponentAccessBean for setting shipment should recieve to ‘N’.
  12. Create RMA entry by calling RMAAccessBean. RMA should have total amount to credit and member id
  13. Now execute ReturnProcessCmd. finally do call super.doProcess(typedproperty). This will take care of changing the order status to X

Above steps will only prepare the data ready for processing the returns and refunds. You need to configure already exisitng scheduler job ReturnCreditAndCloseScan

The above steps will allow you to return partial order and refund partially.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pradeep Batchu

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram