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

Adds list catalog method to Square facade #102

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

Conversation

Mrkbingham
Copy link
Contributor

This adds a method to retrieve catalog data from the Catalog API, allowing users to pass in non (returns all) one or many catalog types.

There are three tests added:

  1. One that confirm the entire catalog can be retrieved
  2. One that confirms the request can be filtered to specific items
  3. One that validates exceptions will be thrown when filtering incorrect items.

Usage
This new method can be used by calling:
Square::listCatalog()
and optionally can take in an array of types:
Square::listCatalog(['ITEM'])

Although it's recommended you use the CatalogObjectType model to prevent issues that arise when using strings:

use Square\Models\CatalogObjectType;

$catalogItems = Square::listCatalog([CatalogObjectType::ITEM]);

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.

1 participant