Open Mrkbingham opened 2 months ago
In case of single store for all products (one location_id) will the code read from env and insert it if the one isn't provided as an input?
In case of single store for all products (one location_id) will the code read from env and insert it if the one isn't provided as an input?
No, it currently does not. There is an existing check for location_id during the charge process though: https://github.com/NikolaGavric94/laravel-square/blob/master/src/SquareService.php#L239
And since it's a required parameter for the setOrder function, it seems unlikely there would be many scenarios where locationId would not be available/passed through. https://github.com/NikolaGavric94/laravel-square/blob/master/src/SquareService.php#L450
There seems to be some errors with current tests, could you take a look and make a fix for it?
@NikolaGavric94 Just to confirm - it looks like, outside of the syntax issues, every other error was getting thrown likely due to the fact that SQUARE_ORDER_NAMESPACE
was not defined during the test run. In particular, this references line 18:
And in line 18 here references the namespace config:
Are there any issues with the secrets in the github workflow file? This branch is passing locally for me when I run the same command in the main.yml file:
vendor/bin/phpunit --migrate-configuration && vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
Link to successful PHPUnit pipeline: https://github.com/Mrkbingham/laravel-square/pull/24/checks
Add location id to the order table
Since all Square orders (created using the Square facade) require a location ID to be added, storing that information will be useful for tracking orders on a per-store basis when integrating this library into other applications. The following changes apply here: