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

[4.x]: getGatewayByHandle returns archived gateway #3839

Open
mikejpeters opened this issue Jan 7, 2025 · 1 comment
Open

[4.x]: getGatewayByHandle returns archived gateway #3839

mikejpeters opened this issue Jan 7, 2025 · 1 comment
Assignees
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce

Comments

@mikejpeters
Copy link

mikejpeters commented Jan 7, 2025

What happened?

Description

Using the getGatewayByHandle method may return an archived gateway.

Steps to reproduce

  1. Create a gateway with the handle "stripe" and then delete (archive) it
  2. Create a new gateway with the same handle "stripe"
  3. In a template call craft.commerce.gateways.getGatewayByHandle('stripe')
  4. The gateway id will match the id of the archived gateway

Expected behavior

The getGatewayByHandle method should only return non-archived gateways.

Actual behavior

The getGatewayByHandle returns the first gateway with the specified handle, even if it's archived.

Craft CMS version

4.13.7

Craft Commerce version

4.7.2

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@mikejpeters mikejpeters added bug commerce4 Issues related to Commerce v4 Craft Commerce labels Jan 7, 2025
Copy link

linear bot commented Jan 7, 2025

mikejpeters added a commit to boundstate/craft-commerce that referenced this issue Jan 7, 2025
mikejpeters added a commit to boundstate/craft-commerce that referenced this issue Jan 8, 2025
@nfourtythree nfourtythree self-assigned this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce
Projects
None yet
Development

No branches or pull requests

2 participants