juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
11.04k stars 1.19k forks source link

feat(router): add refunds manual-update api #5094

Closed sai-harsha-vardhan closed 3 days ago

sai-harsha-vardhan commented 1 week ago

Type of Change

Description

add refunds manual-update api

refunds manual-update api allows to update the refund details like status, error code and error message

Additional Changes

Motivation and Context

How did you test it?

Tested Manually

  1. Create a refund image

  2. Check the status, error code and message in DB image

  3. Call Manual Update API for refund CURL

    curl --location --request PUT '{{API_BASE_URL}}/refunds/{{refund_id}}/manual-update' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: {{ADMIN_API_KEY}}' \
    --data-raw '{
    "merchant_id": "{{MERCHANT_ID}}",
    "status": "failed",
    "error_code": "code",
    "error_message": "message"
    }'

    image

  4. Observe the changes in DB image

Checklist