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(compatibility): add refund retrieve endpoint which accepts gateway creds #958

Conversation

shubhanshu-mani
Copy link
Contributor

@shubhanshu-mani shubhanshu-mani commented Apr 22, 2023

Type of Change

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

Description

This PR is based on the issue #920 to add refund sync with gateway creds in stripe compatibility.
Adds a new service refund_retrieve_with_gateway_creds which parses the JSON to type RefundsRetrieveRequest which already has an optional field merchant_connector_details to accept gateway credentials and then calls the normal refund retrieve API

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?

Checklist

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

@shubhanshu-mani shubhanshu-mani requested a review from a team as a code owner April 22, 2023 09:12
…d-refund-sync-with-gateway-creds-stripe-compatibility
@Abhicodes-crypto Abhicodes-crypto added A-connector-compatibility Area: Connector compatibility C-feature Category: Feature request or enhancement labels Apr 22, 2023
@SanchithHegde SanchithHegde linked an issue Apr 22, 2023 that may be closed by this pull request
2 tasks
@SanchithHegde SanchithHegde changed the title #920 Refund retrieve with gateway creds in stripe compatibility feat(compatibility): add refund retrieve endpoint which accepts gateway creds Apr 22, 2023
Copy link
Member

@SanchithHegde SanchithHegde left a comment

Choose a reason for hiding this comment

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

Other than that, looks good to me!

@@ -49,6 +49,47 @@ pub async fn refund_create(
.await
}

#[instrument(skip_all)]
#[get("/{refund_id}")]
Copy link
Member

Choose a reason for hiding this comment

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

Would this have to be /sync @Abhicodes-crypto? As far as I remember, trying to register two handlers for the same route with the same HTTP method would cause the Actix server to panic at startup.

@@ -49,6 +49,47 @@ pub async fn refund_create(
.await
}

#[instrument(skip_all)]
#[get("/{refund_id}")]
Copy link
Contributor

Choose a reason for hiding this comment

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

The route should be post("/sync").

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@Abhicodes-crypto Abhicodes-crypto left a comment

Choose a reason for hiding this comment

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

Route change requested.

@SanchithHegde SanchithHegde added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Apr 22, 2023
@jarnura jarnura added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 24, 2023
@jarnura jarnura added this pull request to the merge queue Apr 24, 2023
Merged via the queue into juspay:main with commit bcbf4c8 Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Refund Sync route in Stripe compatibility
4 participants