Skip to content

feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service#8178

Merged
likhinbopanna merged 150 commits intomainfrom
build-grpc-client-recovery
Aug 6, 2025
Merged

feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service#8178
likhinbopanna merged 150 commits intomainfrom
build-grpc-client-recovery

Conversation

@AdityaKumaar21
Copy link
Member

@AdityaKumaar21 AdityaKumaar21 commented May 29, 2025

Type of Change

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

Description

I have implemented a gRPC client that facilitates communication with the recovery-decider gRPC service. The client should be capable of initializing and managing the connection to the service, sending requests, and handling responses in accordance with the defined service contract (protobuf definitions).

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?

Decider gRPC server:-
Screenshot 2025-06-11 at 01 16 34

Decider gRPC client(HS):-
Screenshot 2025-06-05 at 02 05 20

Predictor gRPC server:-
Screenshot 2025-06-05 at 02 03 06

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

Summary by CodeRabbit

  • New Features

    • Introduced support for a gRPC client: Recovery Decider, enabling external retry decisioning.
    • Integrated dynamic scheduling for smart retry logic based on external gRPC service responses.
    • Added new protobuf definition for Recovery Decider.
  • Improvements

    • Enhanced revenue recovery payment flow with richer payment intent context and smarter retry scheduling.
    • Expanded logging and API flow tracking with new flow types.
  • Configuration

    • Added configuration options for new gRPC clients in the development environment.
  • Bug Fixes

    • Improved error handling and logging for gRPC client interactions.

Nishanth Challa and others added 30 commits April 2, 2025 14:06
@AdityaKumaar21 AdityaKumaar21 requested review from a team August 5, 2025 06:37
fn from(internal_request: InternalDeciderRequest) -> Self {
Self {
first_error_message: internal_request.first_error_message,
billing_state: internal_request.billing_state.peek().to_string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aprabhat19 @srujanchikke Ideally you folks should consider using an equivalent of Secret on the gRPC server side as well, similar to how the connector-service folks are doing...

process_tracker: storage::ProcessTracker,
revenue_recovery_payment_data: &storage::revenue_recovery::RevenueRecoveryPaymentData,
payment_attempt: payment_attempt::PaymentAttempt,
payment_attempt: PaymentAttempt,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can't we accept a reference here? Do you necessarily need an owned value?

payment_intent: &PaymentIntent,
process: &storage::ProcessTracker,
payment_attempt: payment_attempt::PaymentAttempt,
payment_attempt: PaymentAttempt,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, can't we accept a reference?


#[derive(Debug, serde::Deserialize, Clone, Default)]
pub struct RevenueRecoverySettings {
pub monitoring_threshold_in_seconds: i64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, we don't need an i64?

Copy link
Contributor

@hrithikesh026 hrithikesh026 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core changes LGTM

@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit 654c15e Aug 6, 2025
18 of 22 checks passed
@likhinbopanna likhinbopanna deleted the build-grpc-client-recovery branch August 6, 2025 13:44
pixincreate added a commit that referenced this pull request Aug 7, 2025
…ordea-sepa

* 'main' of github.com:juspay/hyperswitch:
  fix(router): [worldpayvantiv] dispute validations and statuses (#8862)
  chore(version): 2025.08.07.0
  feat(connector): [WORLDPAYVANTIV] Populate Network Decline Error Code & Message (#8856)
  feat(router): add support for partial authorization (#8833)
  feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service (#8178)
  fix(connector): [CYBERSOURCE] fix response field for netcetera authentication response (#8850)
  chore(events): making events nanosecond level precision (#8759)
@hyperswitch-bot hyperswitch-bot bot removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: build gRPC Client Interface to initiate communication with recovery-trainer gRPC service

8 participants