Skip to content
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

feat(connector): [Recurly] Add record back support for recurly [V2] #7544

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

aniketburman014
Copy link
Contributor

@aniketburman014 aniketburman014 commented Mar 18, 2025

Type of Change

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

Description

Add support for record back flow for recurly.

What is record back flow ?

After payment is retried by revenue recovery, we need to update the billing processor invoice.

Recurly flow

We record the transaction in recurly created by internal system. This transaction will automatically update the invoice status in recurly system.

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?

This can only be tested in local since the entire recovery flow is not complete. Tested locally by triggering the connector integration manually.
Here are the local testing logs :

Screenshot 2025-03-20 at 4 21 51 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

@aniketburman014 aniketburman014 requested review from a team as code owners March 18, 2025 07:49
Copy link

semanticdiff-com bot commented Mar 18, 2025

@aniketburman014 aniketburman014 removed request for a team March 18, 2025 07:57
@aniketburman014 aniketburman014 changed the title Recurly record back feat(connector): [Recurly] Add record back support for recurly [V2] Mar 20, 2025
@aniketburman014 aniketburman014 removed the request for review from a team March 20, 2025 08:36
Comment on lines 612 to 618
Ok(format!(
"{}/invoices/{}/{}",
self.base_url(connectors),
invoice_id,
status_endpoint
))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Ok(format!(
"{}/invoices/{}/{}",
self.base_url(connectors),
invoice_id,
status_endpoint
))
}
Ok(format!(
"{}/invoices/{invoice_id}/{status_endpoint}",
self.base_url(connectors)
))
}

Comment on lines 310 to 311
// inovice id
pub id: common_utils::id_type::PaymentReferenceId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// inovice id
pub id: common_utils::id_type::PaymentReferenceId,
// inovice id
pub id: id_type::PaymentReferenceId,

Comment on lines 600 to 605
let status = RecurlyRecordStatus::try_from(req.request.attempt_status).map_err(|_| {
errors::ConnectorError::NotSupported {
message: "Invalid attempt status for Recurly".to_string(),
connector: "recurly",
}
})?;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this map_err required ?

Comment on lines 608 to 609
RecurlyRecordStatus::Success => "mark_successful",
RecurlyRecordStatus::Failure => "mark_failed",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have this string as global variables ?

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Mar 20, 2025
@aniketburman014 aniketburman014 added api-v2 A-connector-integration Area: Connector integration and removed api-v2 labels Mar 20, 2025
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 M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants