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

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, BITPAY, HELCIM, PAYBOX] Replaced lazystatic macros with LazyLock #7524

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bsayak03
Copy link
Contributor

@bsayak03 bsayak03 commented Mar 14, 2025

Type of Change

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

Description

Replaced lazystatic macros with LazyLock

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?

curl --location 'http://localhost:8080/feature_matrix' \
--header 'api-key: dev_VgKvgCJh4w9wsuRjYrPdyWUbarwcp3a9d6zHLiJB5x0yTrGw6dzQwXZjULcV2qzO' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7'

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

@bsayak03 bsayak03 requested a review from a team as a code owner March 14, 2025 07:17
Copy link

semanticdiff-com bot commented Mar 14, 2025

@bsayak03 bsayak03 changed the title Feature matrix fix fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, BITPAY, HELCIM] Replaced lazystatic macros with LazyLock Mar 14, 2025
@bsayak03 bsayak03 changed the title fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, BITPAY, HELCIM] Replaced lazystatic macros with LazyLock fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, BITPAY, HELCIM, PAYBOX] Replaced lazystatic macros with LazyLock Mar 14, 2025
Comment on lines 451 to 452
static BITPAY_SUPPORTED_WEBHOOK_FLOWS: LazyLock<Vec<enums::EventClass>> =
LazyLock::new(|| vec![enums::EventClass::Payments]);
Copy link
Member

Choose a reason for hiding this comment

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

@AkshayaFoiger And this one can be an array instead possibly, depending on how it's being used?

Copy link
Contributor

@AkshayaFoiger AkshayaFoiger Mar 18, 2025

Choose a reason for hiding this comment

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

This can be an array, but this refactoring needs to be done for all the connectors that implements ConnectorSpecifications

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

@bsayak03 bsayak03 self-assigned this Mar 20, 2025
…replaced lazystatic macros with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock

fix(connector): [JPMORGAN, PAYU, DIGITALVIRGO, HELCIM, PAYBOX, PAYU] Replaced lazystatic macros
with LazyLock
PaymentMethodDetails {
mandates: enums::FeatureStatus::NotSupported,
refunds: enums::FeatureStatus::Supported,
supported_capture_methods: supported_capture_methods.clone(),
Copy link
Member

Choose a reason for hiding this comment

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

Why the clone()? I don't see the supported_capture_methods variable being read anywhere?

Please make this change in the other files modified in this PR as well, where there's only one usage of the variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

Comment on lines 449 to 450
static BITPAY_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 1]> =
LazyLock::new(|| [enums::EventClass::Payments]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
static BITPAY_SUPPORTED_WEBHOOK_FLOWS: LazyLock<[enums::EventClass; 1]> =
LazyLock::new(|| [enums::EventClass::Payments]);
static BITPAY_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 1] = [enums::EventClass::Payments];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants