ReturnCreditAndCloseScan command

Refunds for a return merchandise authorization (RMA).

Refunds for a return merchandise authorization (RMA) can be directed to only one destination. Either one account can be credited or one order can be credited.

This scheduler command is designed to perform refunds. This job is not automatically scheduled with the base product because it is run in the context of a store. After you have created a store, you can create the scheduled job using the Administration Console.

The table below describes the environment variable associated with this scheduled command:

Environment variable name Description
storeID The store upon which the command runs.

This command can pass sensitive data to the payment plug-in through the refundInstructionId parameter. This sensitive data is not persisted. The refundInstructionId is the refund instruction id in the EDPREFINST table.

For example:
refundInstructionId_1=10005&pay_data_account_1=4111111111111111&pay_data_cc_cvc_1=111&
refundInstructionId_2=10006&pay_data_account_2=4111111111111111&pay_data_cc_cvc_2=222

Behavior

  • ReturnCreditAndCloseScan scans for RMAs that are eligible to be credited and marked closed. For each RMA with the status 'APP', if all RMA items have been received and none have been credited, then the task command CreditReturnItem is called. If CreditReturnItemCmd raises an exception, then a message (_ERR_RMA_CREDIT_FAILED) is written to the error log. If CreditReturnItemCmd is successful then the RMA is moved to status 'CLO' (closed).
  • CreditReturnItem checks to see if there is a refund. If there is, the approval policy command ApproveRefundPolicy will be run to see if the refund is allowed. The default implementation for this command always allows the refund. After the refund is allowed, the DoRefund task command is executed. On successful completion, all RMA items will have CREDITDATE set.
  • If a third party tax system is integrated, then call TaxCalculationUsageSalesTaxTIKCmd to set the audit flag for the sales tax to be returned.