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(router): add /relay endpoint #6870

Merged
merged 14 commits into from
Dec 20, 2024
Merged

feat(router): add /relay endpoint #6870

merged 14 commits into from
Dec 20, 2024

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Dec 18, 2024

Type of Change

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

Description

/relay is a api that will be used to just forward the request sent my merchant without performing any application logic on it. In this pr the changes is particular to support the refunds for the payments that was directly performed with the connector (example stripe) with out hyperswitch involved during the payment flow.

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?

image image

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

@ShankarSinghC ShankarSinghC added A-core Area: Core flows M-api-contract-changes Metadata: This PR involves API contract changes labels Dec 18, 2024
@ShankarSinghC ShankarSinghC self-assigned this Dec 18, 2024
@ShankarSinghC ShankarSinghC requested a review from a team as a code owner December 18, 2024 06:00
Copy link

semanticdiff-com bot commented Dec 18, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/openapi/src/routes.rs  1% smaller
  api-reference/api-reference/relay/relay--retrieve.mdx Unsupported file format
  api-reference/api-reference/relay/relay.mdx Unsupported file format
  api-reference/mint.json  0% smaller
  api-reference/openapi_spec.json  0% smaller
  crates/api_models/src/lib.rs  0% smaller
  crates/api_models/src/relay.rs  0% smaller
  crates/common_utils/src/id_type.rs  0% smaller
  crates/common_utils/src/id_type/relay.rs  0% smaller
  crates/openapi/src/openapi.rs  0% smaller
  crates/openapi/src/routes/relay.rs  0% smaller

#[serde(rename = "type")]
pub relay_type: RelayType,
/// The data that is associated with the relay request
pub data: Option<RelayData>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add connector_reference_id in the response

/// Identifier of the connector ( merchant connector account ) to which relay request is being made
#[schema(example = "mca_5apGeP94tMts6rg3U3kR", value_type = String)]
pub connector_id: common_utils::id_type::MerchantConnectorAccountId,
/// The business profile that is associated with this payment request
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
/// The business profile that is associated with this payment request
/// The business profile that is associated with this relay request

@ShankarSinghC ShankarSinghC linked an issue Dec 19, 2024 that may be closed by this pull request
pub connector_id: common_utils::id_type::MerchantConnectorAccountId,
/// The business profile that is associated with this relay request
#[schema(example = "pro_abcdefghijklmnopqrstuvwxyz", value_type = String)]
pub profile_id: common_utils::id_type::ProfileId,
Copy link
Member

Choose a reason for hiding this comment

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

move this to headers

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 22de8ad Dec 20, 2024
17 of 19 checks passed
@Gnanasundari24 Gnanasundari24 deleted the relay/api-contract branch December 20, 2024 14:34
}

#[derive(Debug, ToSchema, Clone, Deserialize, Serialize)]
#[serde(rename_all = "snake_case", untagged)]
Copy link
Member

Choose a reason for hiding this comment

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

do not use untagged for deserialization. You can rely on the relay_type to infer this. Can be changed in the subsequent PRs as well

pixincreate added a commit that referenced this pull request Dec 23, 2024
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.12.23.0
  feat(connector): [JPMORGAN] add Payment flows for cards (#6668)
  refactor(grpc): send `x-tenant-id` and `x-request-id` in grpc headers (#6904)
  feat(payment_methods_v2): Added Ephemeral auth for v2 (#6813)
  chore(cypress): payout - fix test cases for adyenplatform bank (#6887)
  refactor(connector): [Airwallex] add device_data in payment request (#6881)
  feat(router): add db interface for `/relay` (#6879)
  feat(payments_v2): implement payments capture v2 (#6722)
  feat(router): add /relay endpoint (#6870)
ShankarSinghC added a commit that referenced this pull request Dec 23, 2024
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add api model changes for /relay endpoint
5 participants