-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service #8178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(gRPC): build gRPC client interface to initiate communication with recovery-decider service #8178
Changes from 139 commits
Commits
Show all changes
150 commits
Select commit
Hold shift + click to select a range
809da65
add address field and attempt_count in stripebilling webhook
8f160b0
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
bd411f5
add endtime and start time of invoice in webhook
2e02b84
ran formatter
fd47398
add full address with encryption
4a82642
consumes required fields to support transaction monitoring[chargebee]
dd531f9
formats the code
01d98a0
Merge branch 'main' into support_for_storing_address
653cd5d
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] 6cae8e1
addresses clippy v2 failure
787912a
chore: run formatter
hyperswitch-bot[bot] a5c5d9a
makes billing address optional
da18869
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
f5d5294
Merge branch 'support_for_storing_address' into stripebilling_transac…
826202a
adds get_billing_address_for_invoice function
d03c564
invoice from webhook for stripebilling
24dac12
add bool to get invoice from webhook or additional call
a4262c7
adds billing connector invoice sync flow
71ec2bc
typo fix
3b04911
add invoice sync flow to revenue recovery
44e5a18
chore: run formatter
hyperswitch-bot[bot] 75ef438
adds config to fetch details
c53b310
recurly invoice sync connector inetgration support
0479693
add invoice sync call support in recovery incoming file
4227dfb
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
69d5d24
recoveryincoming changes
6764550
define ve type and change connector integration v1 to v2
2fe86f9
resolve clippy fails
3142502
add support for transaction monitoring for recurly
49f7a22
Merge branch 'main' into billing_connector_invoice_psync_call
b4c7e71
Merge branch 'billing_connector_invoice_psync_call' into recurly_invo…
a9899b5
resolve spell checks
e93d5a7
resolve spell checks
5aaaea6
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
da5a505
chore: run formatter
hyperswitch-bot[bot] d75b207
format the code and remove print statements
c9f7aa6
cleaning up recurly code
9bebc57
fix clippy_errors
86c9715
removed recurly tests since we dont have any payment related thngs to…
272c416
resolve clippy error
7378787
Merge branch 'main' into billing_connector_invoice_psync_call
NISHANTH1221 23ed82c
resolve clippy errors
23e13fa
resolve merge conflicts
9e30a2a
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
eaf1e40
resolve clippy errors
b154311
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
NISHANTH1221 d2e3caa
remove string based matching
1110062
chore: run formatter
hyperswitch-bot[bot] 7170f7a
Merge branch 'main' into recurly_invoice_sync_support_with_transactio…
79d8e64
resolve error in clippy-v2
964fd78
removes unncessary billing address function in Incoming Webhook Trait
fda03ea
recurly add comment on why we dont need amount convertor
3e619b7
format the code
054bf7f
Merge branch 'recurly_invoice_sync_support_with_transaction_monitorin…
f916cb5
add white space
f0fe9d5
Merge branch 'main' into stripebilling_transaction_monitoring_feilds
1fdab57
consume card details from billing connectors
e1483a3
Merge branch 'main' into add_card_information_for_billing_connectors
264766f
small bug fix for stripebilling external payments sync flow
738037d
build gRPC Client Interface to initiate communication with recovery-t…
AdityaKumaar21 167dccd
chore: run formatter
hyperswitch-bot[bot] 720b422
clippy fix
AdityaKumaar21 86a63b6
chore: run formatter
hyperswitch-bot[bot] 0a516f6
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 4c0503d
add connector level support to consume card network and card bin
48214ee
introducing apis for trainer and decider
AdityaKumaar21 1b619b3
Delete crates/external_services/src/grpc_client/recovery_trainer_clie…
AdityaKumaar21 ae153fb
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 8d78311
Delete proto/recovery_trainer.proto
AdityaKumaar21 0177ba4
chore: update Cargo.lock
hyperswitch-bot[bot] fe2af2e
refactor recovery decider client and update proto definitions
AdityaKumaar21 77b750d
fix clippy
AdityaKumaar21 32a74f9
chore: run formatter
hyperswitch-bot[bot] 4386261
Final Adjustments
a4aac2a
chore: run formatter
hyperswitch-bot[bot] 1bdedf7
add card network in stripe billing
98aeceb
add open api changes
f478efb
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 38378f9
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] d4b6025
add error codes
b7fc94e
bring back v1 from v2
ad3beaa
chore: run formatter
hyperswitch-bot[bot] c6ed016
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] 49e68b5
write correct example for card issuer
35eae6a
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] 9770ff6
resolves comments
60d745a
decider refactor
AdityaKumaar21 bd1913e
Rename comments
NISHANTH1221 f89bf01
chore: run formatter
hyperswitch-bot[bot] 88671ca
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 576b4ab
removed defaults
AdityaKumaar21 5e7297d
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 4c50e55
chore: run formatter
hyperswitch-bot[bot] 71e0b4e
refactor: remove TrainerClient and related gRPC functionality
AdityaKumaar21 3d21400
chore: run formatter
hyperswitch-bot[bot] ffd75fe
add new BillingConnectorPaymentMethodDetails enum
2b1d402
chore: run formatter
hyperswitch-bot[bot] 401c7b5
Merge branch 'main' into add_card_information_for_billing_connectors
aa325bd
make the enum optional
feb3f88
chore: run formatter
hyperswitch-bot[bot] 89405fb
revert default version and add box pin
5cead6b
add v2 feeature flag on conversions
d62ba13
fix proxy
AdityaKumaar21 5de0d97
add type serde tag and write an time stamp desrializing tag on primit…
1b768bf
Merge branch 'main' into add_card_information_for_billing_connectors
NISHANTH1221 0c01259
Merge branch 'add_card_information_for_billing_connectors' into build…
AdityaKumaar21 4edb072
chore: run formatter
hyperswitch-bot[bot] f66a288
addressing comments
AdityaKumaar21 dfdb3e3
Merge remote-tracking branch 'origin' into build-grpc-client-recovery
AdityaKumaar21 51deffb
fix clippy
AdityaKumaar21 c26bded
addressing comments
AdityaKumaar21 77bcbd5
docs(openapi): re-generate OpenAPI specification
hyperswitch-bot[bot] 3aed65b
fix clippy
AdityaKumaar21 dea1639
chore: run formatter
hyperswitch-bot[bot] fa5f1ce
add grpc-recovery-header
AdityaKumaar21 9ecd485
fix clippy
AdityaKumaar21 3eae00b
addressing comment
AdityaKumaar21 a9d90a1
refactoring
AdityaKumaar21 060a33a
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 273acd1
fix feature flags
AdityaKumaar21 0536d0e
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 abf8d50
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 8dd5919
minor changes
AdityaKumaar21 baeb245
minor fix
AdityaKumaar21 7e81472
chore: run formatter
hyperswitch-bot[bot] 920f211
fix clippy
AdityaKumaar21 20a864f
chore: bump tonic version from 0.12 to 0.13
Aprabhat19 2bb5234
Merge remote-tracking branch 'origin/bump_tonic' into build-grpc-clie…
AdityaKumaar21 4b269f1
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 26fee44
Merge remote-tracking branch 'origin' into build-grpc-client-recovery
AdityaKumaar21 ff53383
Merge remote-tracking branch 'origin' into build-grpc-client-recovery
AdityaKumaar21 f791524
feat(revenue_recovery): Introduce recovery timestamp configuration an…
AdityaKumaar21 3818225
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 5da1854
fix clippy
AdityaKumaar21 01aaa59
chore: run formatter
hyperswitch-bot[bot] 553f094
errors fixed
AdityaKumaar21 da3304a
chore: run formatter
hyperswitch-bot[bot] e810940
Update build.rs
AdityaKumaar21 baee0b3
Update Cargo.toml
AdityaKumaar21 99daa29
resolving comments
AdityaKumaar21 560a72b
addressing comments
AdityaKumaar21 7bd8144
fix clippy
AdityaKumaar21 45435cc
chore: run formatter
hyperswitch-bot[bot] 59f5a77
fix clippy
AdityaKumaar21 bdddba9
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 4e19f8f
adding more field in decider request and update the monitoring thresh…
AdityaKumaar21 d973789
formatting
AdityaKumaar21 bbdc2a6
adding more fields in decider request
AdityaKumaar21 c9031ce
Merge branch 'main' into build-grpc-client-recovery
AdityaKumaar21 ee1735d
chore: run formatter
hyperswitch-bot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SanchithHegde marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/// common file for revenue recovery | ||
pub mod common; | ||
SanchithHegde marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Recovery Decider client | ||
pub mod recovery_decider_client; |
54 changes: 54 additions & 0 deletions
54
crates/external_services/src/grpc_client/revenue_recovery/common.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use std::fmt::Debug; | ||
|
||
use common_utils::consts; | ||
use router_env::logger; | ||
|
||
/// Errors in time conversion | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum DateTimeConversionError { | ||
#[error("Invalid timestamp value from prost Timestamp: out of representable range")] | ||
/// Error for out of range | ||
TimestampOutOfRange, | ||
} | ||
|
||
/// Contains recovery grpc headers | ||
#[derive(Debug)] | ||
pub struct GrpcRecoveryHeaders { | ||
/// Request id | ||
pub request_id: Option<String>, | ||
} | ||
|
||
/// Trait to add necessary recovery headers to the tonic Request | ||
pub(crate) trait AddRecoveryHeaders { | ||
/// Add necessary recovery header fields to the tonic Request | ||
fn add_recovery_headers(&mut self, headers: GrpcRecoveryHeaders); | ||
} | ||
|
||
impl<T> AddRecoveryHeaders for tonic::Request<T> { | ||
#[track_caller] | ||
fn add_recovery_headers(&mut self, headers: GrpcRecoveryHeaders) { | ||
headers.request_id.map(|request_id| { | ||
request_id | ||
.parse() | ||
.map(|request_id_val| { | ||
self | ||
.metadata_mut() | ||
.append(consts::X_REQUEST_ID, request_id_val) | ||
}) | ||
.inspect_err( | ||
|err| logger::warn!(header_parse_error=?err,"invalid {} received",consts::X_REQUEST_ID), | ||
) | ||
.ok(); | ||
}); | ||
} | ||
} | ||
|
||
/// Creates a tonic::Request with recovery headers added. | ||
pub(crate) fn create_revenue_recovery_grpc_request<T: Debug>( | ||
message: T, | ||
recovery_headers: GrpcRecoveryHeaders, | ||
) -> tonic::Request<T> { | ||
let mut request = tonic::Request::new(message); | ||
request.add_recovery_headers(recovery_headers); | ||
request | ||
} | ||
SanchithHegde marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.