Skip to content

feat(connector): [Recurly] add invoice sync support along with transaction monitoring #7867

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

Conversation

NISHANTH1221
Copy link
Contributor

@NISHANTH1221 NISHANTH1221 commented Apr 22, 2025

Type of Change

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

Description

Transaction Monitoring means to record all the transaction that are happening in the billing connectors and storing them in our database. So that we can use those to train our model and get insights from that data in revenue recovery flow.
To support monitor the transaction happening in the billing connectors and to get maximum efficiency we need the fields in the issue which are billing address, retry count, subscription next billing date. To make this support for recurly we need invoice api call to recurly. BillingConnectorInvoiceSync will do that work. This PR contains the Connector Integration V2 Implementations of BillingConnectorInvoiceSync , BillingConnectorPaymentsSync and RecoveryRecordBack only for recurly. This PR also contains transaction monitoring support for recurly.

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?

Cannot test it

Here is a picture depicting that we are able to get all the details:
Screenshot 2025-04-22 at 12 38 57 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

@NISHANTH1221 NISHANTH1221 requested review from a team as code owners April 22, 2025 08:48
Copy link

semanticdiff-com bot commented Apr 22, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_domain_models/src/revenue_recovery.rs  65% smaller
  crates/hyperswitch_connectors/src/connectors/recurly.rs  19% smaller
  crates/hyperswitch_interfaces/src/conversion_impls.rs  15% smaller
  crates/hyperswitch_connectors/src/default_implementations.rs  15% smaller
  crates/hyperswitch_connectors/src/default_implementations_v2.rs  15% smaller
  crates/hyperswitch_domain_models/src/configs.rs  5% smaller
  crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs  1% smaller
  config/config.example.toml Unsupported file format
  config/deployments/integration_test.toml Unsupported file format
  config/deployments/production.toml Unsupported file format
  config/deployments/sandbox.toml Unsupported file format
  config/development.toml Unsupported file format
  config/docker_compose.toml Unsupported file format
  crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs  0% smaller
  crates/hyperswitch_connectors/src/types.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_request_types/revenue_recovery.rs  0% smaller
  crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs  0% smaller
  crates/hyperswitch_domain_models/src/types.rs  0% smaller
  crates/hyperswitch_interfaces/src/api/revenue_recovery_v2.rs  0% smaller
  crates/hyperswitch_interfaces/src/types.rs  0% smaller
  crates/hyperswitch_interfaces/src/webhooks.rs  0% smaller
  crates/router/src/configs/secrets_transformers.rs  0% smaller
  crates/router/src/configs/settings.rs  0% smaller
  crates/router/src/core/errors.rs  0% smaller
  crates/router/src/core/revenue_recovery/types.rs  0% smaller
  crates/router/src/core/webhooks/recovery_incoming.rs  0% smaller
  crates/router/src/types/api.rs  0% smaller
  crates/router/tests/connectors/main.rs  0% smaller
  crates/router/tests/connectors/recurly.rs  0% smaller
  loadtest/config/development.toml Unsupported file format

@NISHANTH1221 NISHANTH1221 self-assigned this Apr 22, 2025
@NISHANTH1221 NISHANTH1221 added api-v2 A-connector-integration Area: Connector integration S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 22, 2025
@NISHANTH1221 NISHANTH1221 changed the title feat(connector):[Recurly] add invoice sync support along with transaction monitoring feat(connector): [Recurly] add invoice sync support along with transaction monitoring Apr 22, 2025
@NISHANTH1221 NISHANTH1221 requested review from AdityaKumaar21 and removed request for AdityaKumaar21 April 25, 2025 09:12
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "snake_case")]
pub struct RecurlyInvoiceTransactionsStatus {
pub status: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this supposed to an enum ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, If you remember for chargebee we are doing the same we just wnat this for no. of transactions.

use masking::Secret;
use router::types::{self, api, storage::enums};
use test_utils::connector_auth;
// use hyperswitch_domain_models::payment_method_data::{Card, PaymentMethodData};
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of commenting it out can we delete this file ?

Copy link
Contributor Author

@NISHANTH1221 NISHANTH1221 Apr 27, 2025

Choose a reason for hiding this comment

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

yeah forgot about it.

Base automatically changed from billing_connector_invoice_psync_call to main April 29, 2025 07:26
@likhinbopanna likhinbopanna dismissed srujanchikke’s stale review April 29, 2025 07:26

The base branch was changed.

connector_enums::Connector::Recurly => Ok(self.recurly.clone()),
connector_enums::Connector::Stripebilling => Ok(self.stripebilling.clone()),
connector_enums::Connector::Chargebee => Ok(self.chargebee.clone()),
_ => Err(api_error_response::ApiErrorResponse::IncorrectConnectorNameGiven.into()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you define all other connectors instead of using default ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of the required check is failing when we mention all the connectors. Because connectors are from common_enums and this config is in domain models . This cargo check was failing when I mention all the connnectors
cargo check --all-targets --package hyperswitch_domain_models --no-default-features --features dummy_connector,v1

Co-authored-by: chikke srujan <[email protected]>
srujanchikke
srujanchikke previously approved these changes Apr 30, 2025
srujanchikke
srujanchikke previously approved these changes Apr 30, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue May 2, 2025
Merged via the queue into main with commit bcc57eb May 2, 2025
16 of 20 checks passed
@likhinbopanna likhinbopanna deleted the recurly_invoice_sync_support_with_transaction_monitoring branch May 2, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration api-v2 S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants