Skip to content

feat(revenue): Add support for hard-decline switch for revenue-recovery service#8879

Merged
likhinbopanna merged 15 commits intomainfrom
hard-decline
Aug 21, 2025
Merged

feat(revenue): Add support for hard-decline switch for revenue-recovery service#8879
likhinbopanna merged 15 commits intomainfrom
hard-decline

Conversation

@Aprabhat19
Copy link
Contributor

@Aprabhat19 Aprabhat19 commented Aug 8, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Add support for hard-decline switch for revenue-recovery service. If we encounter a hard-decline we would not call the external service . This PR also adds support for gsm apis in v2

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

  • hit this curl
 curl --location 'http://localhost:8080/v2/gsm' \
--header 'Authorization: admin-api-key=test_admin' \ 
--header 'Content-Type: application/json' \
  --data '{
  "connector": "authipay",
  "flow": "revenue_recovery",
  "sub_flow": "sub_flow",
  "code": "100",
  "message": "Insuffiecient Funds",
  "status": "Failure",
  "decision": "retry",
"clear_pan_possible":false,
"step_up_possible":false,
  "error_category": "hard_decline"
}'
  • Response {"connector":"authipay","flow":"revenue_recovery","sub_flow":"sub_flow","code":"100","message":"Insuffiecient Funds","status":"Failure","router_error":null,"decision":"retry","step_up_possible":false,"unified_code":null,"unified_message":null,"error_category":"hard_decline","clear_pan_possible":false,"feature":"retry","feature_data":{"retry":{"step_up_possible":false,"clear_pan_possible":false,"alternate_network_possible":false,"decision":"retry"}}}%

  • Db entry would be present

Screenshot 2025-08-21 at 5 45 52 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@Aprabhat19 Aprabhat19 requested review from a team as code owners August 8, 2025 12:35
@semanticdiff-com
Copy link

semanticdiff-com bot commented Aug 8, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/lib.rs  76% smaller
  crates/router/src/types/storage/revenue_recovery.rs  70% smaller
  api-reference/v1/openapi_spec_v1.json  50% smaller
  api-reference/v2/openapi_spec_v2.json  50% smaller
  crates/common_enums/src/enums.rs  43% smaller
  crates/router/src/routes/app.rs  6% smaller
  crates/router/src/core/revenue_recovery/types.rs  0% smaller
  crates/router/src/routes/gsm.rs  0% smaller

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 8, 2025
hrithikesh026
hrithikesh026 previously approved these changes Aug 8, 2025
srujanchikke
srujanchikke previously approved these changes Aug 9, 2025
@Aprabhat19 Aprabhat19 dismissed stale reviews from srujanchikke and hrithikesh026 via 5c5e025 August 10, 2025 15:24
srujanchikke
srujanchikke previously approved these changes Aug 10, 2025
hrithikesh026
hrithikesh026 previously approved these changes Aug 11, 2025
@Aprabhat19 Aprabhat19 dismissed stale reviews from hrithikesh026 and srujanchikke via cd65944 August 21, 2025 12:16
@Aprabhat19 Aprabhat19 self-assigned this Aug 21, 2025
@Aprabhat19 Aprabhat19 linked an issue Aug 21, 2025 that may be closed by this pull request
@Aprabhat19 Aprabhat19 changed the title feat(revenue) : Add support for hard-decline switch for revenue-recovery service feat(revenue): Add support for hard-decline switch for revenue-recovery service Aug 21, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 21, 2025
Merged via the queue into main with commit 84a3492 Aug 21, 2025
30 of 43 checks passed
@likhinbopanna likhinbopanna deleted the hard-decline branch August 21, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gsm api for v2

4 participants