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

Closed
2 tasks done
Sakilmostak opened this issue Sep 21, 2023 · 11 comments · May be fixed by #2786
Closed
2 tasks done

[FEATURE]: [Noon] Currency Unit Conversion #2237

Sakilmostak opened this issue Sep 21, 2023 · 11 comments · May be fixed by #2786
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
@ethanbarry
Copy link

Hello! I'd like to give this a shot. Would someone please assign it to me?

Thank you!

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

Hi @DostoevskyOnLinux , I have assigned this issue to you.

@ethanbarry
Copy link

Hmm. I can find another one to fix, I guess...

@Sakilmostak
Copy link
Contributor Author

Hey @DostoevskyOnLinux for any problem in regards to implementation you can hit to our official slack or discord server. We will be glad to help : )

@ethanbarry
Copy link

Sorry, @Sakilmostak, @heckarman said he had a PR open to fix this one. It looks like he has closed it though... He had commented to say as much.

Should I keep working on this? Thank you!

@heckarman
Copy link

heckarman commented Oct 16, 2023

@DostoevskyOnLinux, feel free to take my code. It should work without any issues and it's been tested to be working.

@swangi-kumari
Copy link
Contributor

Hey @DostoevskyOnLinux ,
Are you still working on this issue?
Please let us know if you need any help:)

@ethanbarry
Copy link

Yes, I am! Sorry about the confusion. I've just been poking through the program, trying to make sure I understand what the changes are doing. Thank you for the offer!

@SagarDevAchar
Copy link
Contributor

SagarDevAchar commented Nov 5, 2023

Hey, I'd like to work on this!
I have PRs waiting to be merged and would love to contribute my 10th PR to Hyperswitch!

@SanchithHegde
Copy link
Member

Sure @SagarDevAchar, I'll assign this to you.

@Sakilmostak
Copy link
Contributor Author

Closing because currency conversion implementation have changed

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
7 participants