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

feat(core): Add two new queries (shop-api) to get public payment and shipping methods #3325

Open
wants to merge 2 commits into
base: minor
Choose a base branch
from

Conversation

apoca
Copy link

@apoca apoca commented Jan 20, 2025

Description

I propose adding two public GraphQL queries in the Vendure core:

1.	activePaymentMethods – Returns a list of all active PaymentMethods.
2.	activeShippingMethods – Returns a list of all active ShippingMethods.

These queries would allow frontend developers to dynamically fetch and display the current active methods without requiring access to the cart or checkout state. This would ensure consistency between the backend configuration and the frontend display, reducing the need for manual intervention when changes are made.

query activePaymentMethods {
  activePaymentMethods {
      id
      name
      code
      description
      translations {
        id
	languageCode
        name
        description
      }
    }
}

query activeShippingMethods {
  activeShippingMethods {
      id
      name
      code
      description
      translations {
        id
	languageCode
        name
        description
      }
    }
}

issue: #3312

Breaking changes

n/a

Screenshots

n/a

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Jan 20, 2025 4:10pm

Copy link
Contributor

github-actions bot commented Jan 20, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@apoca
Copy link
Author

apoca commented Jan 20, 2025

I have read the CLA Document and I hereby sign the CLA

@apoca
Copy link
Author

apoca commented Jan 21, 2025

@michaelbromley, another thing, I think that both the payment method and the shipping method could have an associated asset (image), so we could use the brand logos... What we will do if this is not possible on the Vendure part is to use the customField for this. , but it honestly doesn't feel right to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 Under consideration
Development

Successfully merging this pull request may close these issues.

2 participants