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(payment_methods): add BankRedirect payment method data to new domain type to be used in connector module #4175

Merged
merged 14 commits into from
Apr 8, 2024

Conversation

swangi-kumari
Copy link
Contributor

@swangi-kumari swangi-kumari commented Mar 22, 2024

Type of Change

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

Description

We need to have separate types for api model and domain, currently we are using the api type in application as well.
This PR add a new domain type for BankRedirect payment_method_data to be used everywhere in the application.

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?

  • Sanity test of payments.

Impact

  • No impact on any flow or connector

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

@swangi-kumari swangi-kumari added A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Mar 22, 2024
@swangi-kumari swangi-kumari marked this pull request as ready for review April 3, 2024 09:40
@swangi-kumari swangi-kumari requested review from a team as code owners April 3, 2024 09:40
@@ -874,218 +874,220 @@ pub enum OnlineBankingSlovakiaBanks {
Viamo,
}

impl TryFrom<&api_enums::BankNames> for OnlineBankingSlovakiaBanks {
impl TryFrom<&common_enums::enums::BankNames> for OnlineBankingSlovakiaBanks {
Copy link
Member

Choose a reason for hiding this comment

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

why do we have common_enums::enums can't we directly use common_enums since there are re exports?

Comment on lines 435 to 438
billing_details: billing_details.map(|billing| BankRedirectBilling {
billing_name: billing.billing_name,
email: billing.email,
}),
Copy link
Member

Choose a reason for hiding this comment

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

You can have a From impl for this since this is reused many times

Comment on lines 647 to 654
fn map_billing_details(
billing_details: Option<api_models::payments::BankRedirectBilling>,
) -> Option<BankRedirectBilling> {
billing_details.map(|billing| BankRedirectBilling {
billing_name: billing.billing_name,
email: billing.email,
})
}
Copy link
Member

Choose a reason for hiding this comment

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

This could have been a From impl

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Narayanbhat166
Narayanbhat166 previously approved these changes Apr 8, 2024
@swangi-kumari swangi-kumari self-assigned this Apr 8, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Apr 8, 2024
Merged via the queue into main with commit e0e8437 Apr 8, 2024
9 of 12 checks passed
@likhinbopanna likhinbopanna deleted the domain-BankRedirect branch April 8, 2024 12:34
kashif-m pushed a commit that referenced this pull request Apr 10, 2024
…w domain type to be used in connector module (#4175)

Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants