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): [Noon] Currency Unit Conversion #2786

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

Conversation

SagarDevAchar
Copy link
Contributor

Type of Change

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

Description

  • Addressing Issue [FEATURE]: [Noon] Currency Unit Conversion #2237
  • Modified two files in hyperswitch/crates/router/src/connector/
    • noon.rs
      • Implement get_currency_unit function
      • Modify ConnectorIntegration implementations for Noon
    • noon/transformers.rs
      • Implement NoonRouterData<T> structure and functionality
      • Modify implementation for NoonPaymentsRequest

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 the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@SagarDevAchar SagarDevAchar requested a review from a team as a code owner November 5, 2023 11:34
@SanchithHegde SanchithHegde linked an issue Nov 5, 2023 that may be closed by this pull request
2 tasks
@SanchithHegde SanchithHegde added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 5, 2023
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger left a comment

Choose a reason for hiding this comment

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

@SagarDevAchar, please resolve the conflicts and implement currency conversion for payments capture flow
ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>

Comment on lines 656 to +658
amount: conn_utils::to_currency_base_unit(
item.request.refund_amount,
item.request.currency,
item.router_data.request.refund_amount,
item.router_data.request.currency,
Copy link
Contributor

Choose a reason for hiding this comment

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

Use item.amount, in place of to_currency_base_unit().
As in noon.rs we already call the tryfrom for currency conversion incase of Refund

Comment on lines +386 to +389
amount: conn_utils::to_currency_base_unit(
item.router_data.request.amount,
item.router_data.request.currency,
)?,
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
amount: conn_utils::to_currency_base_unit(
item.router_data.request.amount,
item.router_data.request.currency,
)?,
amount: item.amount.clone(),

@AkshayaFoiger
Copy link
Contributor

AkshayaFoiger commented Mar 12, 2024

Hello @SagarDevAchar,
If you are stuck, please feel free to raise your query in this thread

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 C-feature Category: Feature request or enhancement 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.

[FEATURE]: [Noon] Currency Unit Conversion
3 participants