Skip to content

feat: support multiple payment gateway#21374

Open
ijitendrasap wants to merge 10 commits intodevelopfrom
multi-payment-gateway
Open

feat: support multiple payment gateway#21374
ijitendrasap wants to merge 10 commits intodevelopfrom
multi-payment-gateway

Conversation

@ijitendrasap
Copy link
Copy Markdown
Contributor

No description provided.

@ijitendrasap ijitendrasap requested a review from a team as a code owner April 15, 2026 11:07
@github-actions github-actions Bot marked this pull request as draft April 15, 2026 11:07
@ijitendrasap ijitendrasap marked this pull request as ready for review April 15, 2026 11:08
@cypress
Copy link
Copy Markdown

cypress Bot commented Apr 15, 2026

spartacus    Run #52820

Run Properties:  status check passed Passed #52820  •  git commit 25a34751d1 ℹ️: Merge 4226fa93277ce752f5faa133779cf2643c64c29b into 869abacf05f3a59b43edcbc631ad...
Project spartacus
Branch Review multi-payment-gateway
Run status status check passed Passed #52820
Run duration 04m 22s
Commit git commit 25a34751d1 ℹ️: Merge 4226fa93277ce752f5faa133779cf2643c64c29b into 869abacf05f3a59b43edcbc631ad...
Committer ijitendrasap
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 101
View all changes introduced in this branch ↗︎

@github-actions github-actions Bot marked this pull request as draft April 16, 2026 11:54
@ijitendrasap ijitendrasap marked this pull request as ready for review April 20, 2026 07:12
@github-actions github-actions Bot marked this pull request as draft April 20, 2026 11:19
@ijitendrasap ijitendrasap marked this pull request as ready for review April 20, 2026 11:26
@github-actions github-actions Bot marked this pull request as draft April 21, 2026 15:19
@ijitendrasap ijitendrasap marked this pull request as ready for review April 21, 2026 15:19
Copy link
Copy Markdown
Contributor

@Matejk00 Matejk00 left a comment

Choose a reason for hiding this comment

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

Please make sure this stays backward compatible. Changing APIs from a single OpfActiveConfiguration to OpfActiveConfiguration[] (and similar signature changes like activeConfiguration → activeConfigurations) is a breaking change for existing consumers.

We’d like this to be strictly backward compatible and preserve the exact old behavior when a single OpfActiveConfiguration is provided. Only when an array is passed should we execute the new multi-config logic.

Concretely, please add explicit branching everywhere the new logic is used, e.g.:

@Input() activeConfiguration: OpfActiveConfiguration | OpfActiveConfiguration[];
if (Array.isArray(this.activeConfiguration)) {
  // here TS knows: OpfActiveConfiguration[]
  // run NEW multi-config logic
} else {
  // here TS knows: OpfActiveConfiguration
  // keep OLD single-config logic
}

Same principle for any helpers/services that changed from activeConfiguration → activeConfigurations: keep the old single-config path intact, and only use the new code when an array is actually provided.

Comment on lines 26 to 43
@@ -37,7 +37,7 @@ export class OpfQuickBuyButtonsComponent implements OnInit {

isPaymentMethodEnabled(
provider: OpfQuickBuyProviderType,
activeConfiguration: OpfActiveConfiguration
activeConfiguration: OpfActiveConfiguration[]
): boolean {
return this.opfQuickBuyButtonsService.isQuickBuyProviderEnabled(
provider,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we change @Input() activeConfiguration from OpfActiveConfiguration to OpfActiveConfiguration[], that’s a breaking change: existing consumers binding [activeConfiguration]="config" (single object) will no longer type-check/compile and would have to pass an array instead.
Can we avoid/omit this API change (e.g., keep the input as a single OpfActiveConfiguration and derive what we need internally), or provide a backwards-compatible input shape?

@Input() activeConfiguration:
  | OpfActiveConfiguration
  | OpfActiveConfiguration[];

get activeConfigurations(): OpfActiveConfiguration[] {
  const value = this.activeConfiguration;
  return Array.isArray(value) ? value : value ? [value] : [];
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’ve kept the input variable as a single OpfActiveConfiguration and used a getter to normalize it into an array internally.

@github-actions github-actions Bot marked this pull request as draft April 23, 2026 12:10
@ijitendrasap ijitendrasap marked this pull request as ready for review April 23, 2026 12:46
@github-actions
Copy link
Copy Markdown
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build.
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

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.

2 participants