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

[FEATURE]: [Worldline] Currency Unit Conversion #2249

Closed
2 tasks done
Sakilmostak opened this issue Sep 21, 2023 · 2 comments · Fixed by #2569
Closed
2 tasks done

[FEATURE]: [Worldline] Currency Unit Conversion #2249

Sakilmostak opened this issue Sep 21, 2023 · 2 comments · Fixed by #2569
Assignees
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement good first issue Good for newcomers hacktoberfest Issues that are up for grabs for Hacktoberfest participants

Comments

@Sakilmostak
Copy link
Contributor

📝 Feature Description

  • Each currency can be described in terms of base or minor units.
  • For instance, when dealing with USD currency, the Cent is considered as the minor unit, while the Dollar is considered the base unit.
  • In Hyperswitch, the amount value is expected to be always provided in minor units.
  • For example: In USD, If the amount is 1 in base unit (Dollar), then it will be equivalent to 100 in minor units (Cent)
  • Some of the connectors integrated require the amount to be converted to a desirable unit before being passed to them.
  • We have functions to_currency_base_unit and to_currency_lower_unit in place to convert the minor unit amount to its decimal equivalent and vice versa. These conversions are handled explicitly based on the connector.

🔨 Possible Implementation

  • ConnectorCommon trait have been implemented for the connector.
  • This trait contains get_currency_unit method. This method needs to be implemented.
  • It will define what type of conversion needs to be done during connector_router_data creation. Concurrently handle the creation of connector_router_data to be passed for the connector request body creation.
  • You can check this PR for further reference refactor(connector): [Zen] Enhance currency Mapping with ConnectorCurrencyCommon Trait #2196

🔖 Note: All the changes needed should be contained within hyperswitch/crates/router/src/connector/

📦 Have you spent some time checking if this feature request has been raised before?

  • I checked and didn't find a similar issue

📦 Have you read the Contributing Guidelines?

✨ Are you willing to submit a PR?

@Sakilmostak Sakilmostak added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement S-awaiting-triage Status: New issues that have not been assessed yet hacktoberfest Issues that are up for grabs for Hacktoberfest participants labels Sep 21, 2023
@VedantKhairnar VedantKhairnar added the good first issue Good for newcomers label Sep 28, 2023
@Suraj3240
Copy link
Contributor

@VedantKhairnar Can you assign this issue to me?

@Sakilmostak Sakilmostak removed the S-awaiting-triage Status: New issues that have not been assessed yet label Oct 12, 2023
@Sakilmostak
Copy link
Contributor Author

Hello @Suraj3240, I have assigned this issue to you👍

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 good first issue Good for newcomers hacktoberfest Issues that are up for grabs for Hacktoberfest participants
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants