Credit-Line Returns
This feature allows customer to return the payout (Regular or EMI converted) transaction.
DB tables Modifications
Added new column in f_credit_line_emi_summary named return_amount.
New table f_credit_account_transaction_return_config for return configurations.
Run the following sql query in the instance
INSERT INTO `f_credit_account_transaction_return_config` (`config_json`)
VALUES
('{\n \"regularTransactionReturnStrategy\":{\n \"unbilledTransactionReturn\":{\n \"handlingStrategy\":\"UNDO_PAYOUT\"\n },\n \"billedTransactionReturn\":{\n \"handlingStrategy\":\"PAYIN\"\n }\n },\n \"emiConvertedTransactionReturnStrategy\":{\n \"interestHandlingStrategy\":\"WAIVE\",\n \"chargesHandlingStrategy\":\"WAIVE_ALL\"\n },\n \"returnAmountHandlingStrategy\":{\n \"remainingReturnAmountHandlingStrategy\":\"EXCESS\",\n \"knockoffStrategy\":\"principal-interest\"\n },\n \"allowReturn\":true\n}');
Or Paste the following configuration manually in the table
{
"regularTransactionReturnStrategy":{
"unbilledTransactionReturn":{
"handlingStrategy":"UNDO_PAYOUT"
},
"billedTransactionReturn":{
"handlingStrategy":"PAYIN"
}
},
"emiConvertedTransactionReturnStrategy":{
"interestHandlingStrategy":"WAIVE",
"chargesHandlingStrategy":"WAIVE_ALL"
},
"returnAmountHandlingStrategy":{
"remainingReturnAmountHandlingStrategy":"EXCESS",
"knockoffStrategy":"principal-interest"
},
"allowReturn":true
}
Now update f_product_config_mapping tables’s return_config_id to the primary key of newly created f_credit_account_transaction_return_config new row inserted.
Use the following curl to test the feature.
curl --location 'http://localhost:8080/fineract-provider/api/v1/revolving-credit-lines/0001017VAK/transactions/73114bf8-64dc-4c31-b4d5-e4e4dcc091c2/return' \
--header 'Fineract-Platform-TenantId: default' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 89b3f59a-37aa-40d8-b627-e182741de04d' \
--data '{
"amount":3000,
"notes":"3000 partial return",
"transactionTime":1680598826000
}'
Note : On passing full payout amount this API behaves as full-return, on passing amount lesser than payout amount , it behaves as partial-return.