Skip to content

Conversation

frazar
Copy link
Contributor

@frazar frazar commented Oct 9, 2023

Type of Change

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

Description

For all payment methods, Hyperswitch should transmit a reference to the connector, enabling merchants to subsequently locate the payment within the connector dashboard.
In this PR, such reference is obtained by calling connector_request_reference_id() in RouterData. The result is then passed as the "merchantOrderId" parameter to the NexiNets API, as per the official documentation.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Fixes #2307

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

@frazar frazar requested a review from a team as a code owner October 9, 2023 20:55
@github-actions github-actions bot added the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Oct 9, 2023
@frazar frazar changed the title WIP: feat(nexinets): Use connector_request_reference_id as reference to the connector feat(nexinets): Use connector_request_reference_id as reference to the connector - Work In Progress Oct 9, 2023
@github-actions github-actions bot removed the S-conventions-not-followed Status: This PR does not follow contributing guidelines label Oct 9, 2023
@frazar frazar force-pushed the nexipay-connector_request_reference_id branch 2 times, most recently from da0725d to beecccd Compare October 10, 2023 06:02
@prasunna09 prasunna09 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 hacktoberfest Issues that are up for grabs for Hacktoberfest participants labels Oct 10, 2023
@@ -179,6 +180,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for NexinetsPaymentsRequest {
product,
payment,
nexinets_async,
merchant_order_id: Some(item.connector_request_reference_id.clone()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @frazar ,

as per api docs of nexinets merchant_order_id can only be sent in case of cards . So this should only be populated incase of card payments .

let merchant_order_id = match item.payment_method {
            // Merchant order id is sent only in case of card payment
            enums::PaymentMethod::Card => Some(item.connector_request_reference_id.clone()),
            _ => None,
        };

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I applied the suggested changes.

srujanchikke
srujanchikke previously approved these changes Oct 11, 2023
@srujanchikke
Copy link
Contributor

Please make the suggested changes , Other than that looks good to me

@frazar frazar force-pushed the nexipay-connector_request_reference_id branch 2 times, most recently from fe72903 to e01173c Compare October 12, 2023 14:59
The reference is passed as the "merchantOrderId" attribute, as described in NexiNets documentation:
https://developer.nexigroup.com/payengine/en-EU/api/payengine-api-v1/#orders-debit-post
@frazar frazar force-pushed the nexipay-connector_request_reference_id branch from e01173c to eff5605 Compare October 12, 2023 15:00
Copy link
Contributor

@srujanchikke srujanchikke left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

Looks good to me!

Thanks for the PR, @frazar!

@SanchithHegde SanchithHegde added this pull request to the merge queue Oct 13, 2023
Merged via the queue into juspay:main with commit 088dce0 Oct 13, 2023
@frazar frazar deleted the nexipay-connector_request_reference_id branch October 13, 2023 06:10
@frazar
Copy link
Contributor Author

frazar commented Oct 13, 2023

Thank you all for your guidance and support!

@SanchithHegde SanchithHegde added hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Oct 15, 2023
@VedantKhairnar
Copy link
Contributor

Hey @frazar 👋,
Thanks a bunch for all your contributions! We've got a little something for you to show our appreciation.
Just take a moment to fill out this form, and get ready for some awesome swag coming your way.
Thanks!

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 hacktoberfest Issues that are up for grabs for Hacktoberfest participants hacktoberfest-accepted Pull requests accepted as Hacktoberfest contributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: [Nexi Nets] Use connector_request_reference_id as reference to the connector
5 participants