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

refactor(connector): [PowerTranz] refactor powertranz payments to remove default cases #2547

Merged
merged 16 commits into from
Oct 22, 2023

Conversation

Himanshu-370
Copy link
Contributor

@Himanshu-370 Himanshu-370 commented Oct 11, 2023

Type of Change

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

Description

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

… payments

Introduces the "connector_request_reference_id" field in the "RouterData" structure to improve consistency in transmitting payment information to the Nuvei payment gateway. This new ID will replace the usage of "payment_id" and "attempt_id", aligning with the Nuvei API requirements for referencing payments.

This change ensures that all payment requests to Nuvei use a unified reference ID, reducing potential confusion and streamlining the integration process.

Fixes juspay#2309
…ents

This change ensures that all payment variants are handled explicitly to Powertranz payment gateway.

Fixes juspay#2283
@Himanshu-370 Himanshu-370 requested a review from a team as a code owner October 11, 2023 13:10
@Himanshu-370
Copy link
Contributor Author

I see there is an error for into_report line. How do I resolve this?
image

@srujanchikke
Copy link
Contributor

I see there is an error for into_report line. How do I resolve this? image

use error_stack::IntoReport import this in transformer.rs

@srujanchikke srujanchikke added A-connector-integration Area: Connector integration S-waiting-on-author Status: This PR is incomplete or needs to address review comments hacktoberfest Issues that are up for grabs for Hacktoberfest participants labels Oct 11, 2023
@srujanchikke srujanchikke linked an issue Oct 11, 2023 that may be closed by this pull request
2 tasks
@Himanshu-370
Copy link
Contributor Author

I can see api_models::payments::PaymentMethodData::Wallet(_) was not present in the default handling cases. I have now included in it and just want to confirm that whether the below code is correct and formatted properly?

image

_ => Err(errors::ConnectorError::NotImplemented(
"Payment method".to_string(),
)),
api::PaymentMethodData::CardRedirect(_)
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
api::PaymentMethodData::CardRedirect(_)
api::PaymentMethodData::Wallet(_)
| api::PaymentMethodData::CardRedirect(_)

Here you haven't include wallet enum. This is the reason for clippy check to fail.

Comment on lines 120 to 122
// _ => Err(errors::ConnectorError::NotImplemented(
// "Payment method".to_string(),
// )),
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
// _ => Err(errors::ConnectorError::NotImplemented(
// "Payment method".to_string(),
// )),

Please remove these comments

@Himanshu-370
Copy link
Contributor Author

Does this looks fine? @prasunna09 ?

image

@SanchithHegde SanchithHegde removed the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Oct 22, 2023
@SanchithHegde SanchithHegde added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels Oct 22, 2023
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.

LGTM!

Copy link
Contributor

@prasunna09 prasunna09 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for you contribution. @Himanshu-370

@SanchithHegde SanchithHegde added this pull request to the merge queue Oct 22, 2023
@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 22, 2023
Merged via the queue into juspay:main with commit 664093d Oct 22, 2023
10 checks passed
@swangi-kumari
Copy link
Contributor

Hey @Himanshu-370 ,
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-refactor Category: Refactor 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.

[REFACTOR]: [PowerTranz] Remove Default Case Handling
5 participants