Warning Do NOT add Pull Requests to this repository, we are currently in the process of moving to the new Lunar name - we'll be back soon!
GetCandy is open-sourced software licensed under the MIT license.
GetCandy v1 E-Commerce API
Home Page: https://getcandy.io
License: Apache License 2.0
Warning Do NOT add Pull Requests to this repository, we are currently in the process of moving to the new Lunar name - we'll be back soon!
GetCandy is open-sourced software licensed under the MIT license.
URL: http://candy.localhost.
Client error:
POST http://candy.localhost/oauth/token` resulted in a 401 Unauthorized
response: {"error":"invalid_client","message":"Client authentication failed"} (View: C:\wamp64\www\candy\resources\views_layouts\base.blade.php) (View: C:\wamp64\www\candy\resources\views_layouts\base.blade.php)`
Solution?
Afternoon guys ๐
So, the route api/v1/baskets/saved/{basket}
api/v1/baskets/{basket}
(EDIT) is defined in routes/api.client.php, at line 45, the method it calls (BasketController@update
) has no implementation. Is it possible it is missing, or that it shouldn't have been defined in the first place?
It seems @store
is doing the PUT behaviour instead, but by passing the ID in the request under the key basket_id
.
Just wanted to check this is intentional, and not accidentally missed?
I'm looking to create and then update a basket, and wasn't clear the routine based on these methods.
Currently I seem to have to do the following:
// Create an empty basket for a user
CandyClient::Basket()->Update([
'user' => 'l8mabw7w',
]);
// Create a basket for a user with products in it
CandyClient::Basket()->Update([
'user' => 'l8mabw7w',
'variants' => [
[
'id' => 'lmawh7sd',
'quantity' => 1,
],
],
]);
// Update an existing basket to set different products
CandyClient::Basket()->Update([
'basket_id' => '24lpwzf2',
'variants' => [
[
'id' => '7ujjyans',
'quantity' => 2,
],
],
]);
Does this seem correct? The above all uses the @store
method on BasketController, rather than the last one using @update
, which I would have expected it to use.
Cheers!
Moved from getcandy/candy-store#4 by @admench
Thanks for such a 'rich' platform, can't wait to explore it all...
Creating new product, z-index of slug error BELOW modal overlay so not readable
i am getting this message after submitting any form in the cms.
I deploy the server individually for Elastic, and how to modify the default Elastic Host?
I want to launch the quick start store doing php artisan serve
but instead I get an error when I click the URL.
Getting this error.
No idea. I'm new to this.
There is a new database migration for adding Fraud Fields to the Transactions table.
Unfortunately the down()
function is referencing the discounts
table instead of the transactions
table. This is resulting in failed table rollbacks.
As a side note, the migration also has a 2019 prefix, when it should be 2018?
Seems to be because of the way vue loads in components, they technically don't exist so it's unable to find the correct save method to attach.
Hi!
On page https://github.com/getcandy/candy-store I can't found instructions about candy-hub.
Where I can find guidelines for your products?
cURL error 6: Could not resolve host: candy-store.test (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Salut j'ai vraiment besoin d'aide pour l'installation et la configuration. Comment faire pour voir la boutique.
This would probably need to be stored in the database, then sent to Algolia.
On fresh candy-store install on php 7.2.1:
Visiting:
https://getcandy.local/hub/catalogue-manager/products
(no products set-up in store)
get a loading icon instead of No Products Found
This is because a call to the api at:
https://getcandy.local/api/v1/products?type=product&per_page=25¤t_page=1&includes=channels,customer_groups,family,attribute_groups
sends back a response of:
message: "count(): Parameter must be an array or an object that implements Countable"
because:-
if (count($ids)) { }
[ie. count(null)] throws an error on php >=7.2 in the following classes:
/src/API/Products/Services/ProductService.php
/src/API/User/Services/UserService.php
Use instead:
if (!empty($ids)) { }
further:
yiisoft/yii#4167
let me know if you want a pull request for this.
As a beginner, I wonder if i should make "composer require ..." command on a new directory or a laravel project?
Thx!
And it would be very nice if you could provide more detail document or some guide for a new beginner.
Make sure product option generation is smooth and makes sense.
Also update Delivery drivers etc for products
CandyEvent.$emit('select-tab', 'product-details');
fires the event in the Vue console in chrome, but doesn't seem to get picked up by the listener.
cURL error 60: SSL certificate problem: unable to get local issuer certificate
I'd downloaded file cacert.pem into c:/openserver/modules/php/PHP-7.1/extras/ssl
My php.ini:
[curl]
curl.cainfo = "c:/openserver/modules/php/PHP-7.1/extras/ssl/cacert.pem"
Then I restarted Open Server
Hello,
can you help me in installing the package with Laravel 7
Hi,
I am not familiar with Elasticsearch so pardon me if I am misunderstanding something. Seems that search function is bound to Elasticsearch. Since not all installation will run on a dedicated server and not all hosting providers support Elasticsearch is it OK to limit search function to a third party like Elasticsearch? I think some internal indexing might be a better choice.
Regards
Server error: POST http://.../api/oauth/token
resulted in a 500 Internal Server Error
response: <!-- ErrorException: Undefined variable: language (View: /home/.../public_html/resources/views/_i (truncated...) (View: /home/.../public_html/resources/views/_layouts/base.blade.php) (View: /home/.../public_html/resources/views/_layouts/base.blade.php)
When running PHPUnit I get the error:
Undefined variable: loader
/home/vagrant/Code/candy/bootstrap/app.php:44
/home/vagrant/Code/candy/tests/CreatesApplication.php:16
/home/vagrant/Code/candy/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:89
/home/vagrant/Code/candy/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:66
Which I assume is to do with this $app->instance('composer_loader', $loader);
.
If I remove it then I get ReflectionException: Class composer_loader does not exist
Any plans or workaround on how to remove elasticsearch ?
what is the purpose of elasticsearch in Candy ?
Following the examples in the candy-store, I'm attempting to create a user using the API client. Using the new facade name (CandyClient) instead of the old one (GetCandyClient), the client is failing when trying to requestToken:
private function requestToken($params)
{
try {
$response = $this->client->post('oauth/token', [ // <---- HERE
'form_params' => array_merge(
[
'client_id' => $this->getClientId(),
'client_secret' => $this->getClientSecret()
],
$params
),
'verify' => config('services.ecommerce_api.verify'),
]);
} catch (ClientException $e) {
return new ApiResponse($e->getResponse());
}
return new ApiResponse($response);
}
...complaining that $this->client
isn't set. I saw an init()
in the client's Candy
class that created the client, but I can't see where this method is called in the store (or anywhere else).
CandyClient::Customers()->create($customer);
(or anything else)please help to sole this error
cURL error 6: Could not resolve host: candy-store.test
I'm in the process of writing some preliminary tests for our store and need to mock the CandyClient's behaviour.
I've spotted the Client::fake()
method... Can you provide some insight on how to write tests, with maybe an example or two? The more details you can give, the better!
a) Image file must be uploaded and appears as an item in media section.
b) When uploading large files an error must indicate why file upload has failed
Not sure
Since master branch is full of bugs and it is almost unusable, I used dev branches of api and hub in candy-store repo. I also had to do a few namespace modifications (mentioned here: #75 (comment)) to get it working.
I suggest to merge dev into master branch more regularly to cover some serious bugs. master branch is 8 months outdated!!
RE: Whirli (CC @Jamiewarb and @shaunrainer)
From looking at the code here https://github.com/getcandy/candy-hub/blob/dev/resources/views/partials/scripts.blade.php when I load the warehouse page it should load candy-hub/js/hub.js
.
It is trying to load candy-hub/js/app.js
but getting a 404.
composer install
etc.php artisan vendor:publish --tag="public"
php artisan candy:elastic:index
/warehouse
and see in the console the error:GET https://whirli.local/candy-hub/js/app.js net::ERR_ABORTED 404 (Not Found)
.Logging into the candy hub warehouse to make progress on the Whirli site.
Client error: POST http://localhost/oauth/token
resulted in a 404 Not Found
response: <title>404 Not Found</title>
cURL error 6: Could not resolve host: candy-store.test
Hi guys,
There are a few migration rollbacks missing from the most recent migration files.
I've added these in the following PR #85
Cheers!
Ported from getcandy/candy-store#2 by @xJoeyv
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in yo
ur SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json n
ull, `remember_token` varchar(100) null, `created_at` timestamp null, `upd' at line 1 (SQL: create table `user_details`
(`id` int unsigned not null auto_increment primary key, `title` varchar(255) null, `firstname` varchar(255) null, `lastn
ame` varchar(255) null, `contact_number` varchar(255) null, `vat_no` varchar(255) null, `company_name` varchar(255) null
, `fields` json null, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) defa
ult character set utf8mb4 collate utf8mb4_unicode_ci)
at D:\xampp\htdocs\Candy\vendor\laravel\framework\src\Illuminate\Database\Connection.php: 664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; chec
k the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, `remember_toke
n` varchar(100) null, `created_at` timestamp null, `upd' at line 1")
D:\xampp\htdocs\Candy\vendor\laravel\framework\src\Illuminate\Database\Connection.php : 452
2 PDO::prepare("create table `user_details` (`id` int unsigned not null auto_increment primary key, `title` varchar(
255) null, `firstname` varchar(255) null, `lastname` varchar(255) null, `contact_number` varchar(255) null, `vat_no` var
char(255) null, `company_name` varchar(255) null, `fields` json null, `remember_token` varchar(100) null, `created_at` t
imestamp null, `updated_at` timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci")
D:\xampp\htdocs\Candy\vendor\laravel\framework\src\Illuminate\Database\Connection.php : 452
Please use the argument -v to see more details.
This is the issue that came up upon starting the installation. I'm looking into this asap aswell. Unless you got a quick fix.
Api endpoint calls via hub interface should not return errors
Getting '401 Unauthorized' when accessing api endpoint
??
Did a fresh install from github
Trying to login to http://candy-store.test/hub and I'm successful except for all http://candy-store.test/api calls are being rejected with a 401 error and the interface features are not useable. Example of api calls generating 401 errors from browser console
http://candy-store.test/api/v1/channels
http://candy-store.test/api/v1/taxes
http://candy-store.test/api/v1/languages
There must be a better way to handle this exception.
Maybe a simple "You did not install candy-hub" error message.
During installation I get this error message towards the end...
Exception could be handled better.
OS: Linux centOS
PHP: 7.2
MySQL: 5.6
Error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json null, `remember_token` varchar(100) null, `created_at` timestamp null, `upd' at line 1 (SQL: create table `user_details` (`id` int unsigned not null auto_increment primary key, `title` varchar(255) null, `firstname` varchar(255) null, `lastname` varchar(255) null, `contact_number` varchar(255) null, `vat_no` varchar(255) null, `company_name` varchar(255) null, `fields` json null, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8 collate utf8_unicode_ci)
How to replicate
php artisan candy:install
Could it be that I'm the first to notice this?
Line 167 in 9124ddf
I'm trying to write a couple of tests for some added functionality to the API and using SQLite for the tests, as CandyAPI seems to be. In the 2018_01_15_120102_add_fields_to_transactions migration there are multiple dropColumns in the same transaction - how did you get that to pass, with SQLite not supporting this behaviour?
Would probably need to index where it's visible etc.
Do we need indexes for each customer group?!
The way that Laravel validates arrays has made it a bit awkward.
I know if solved a similar problem like this before, think my minds just a bit melted so will check back in the morning!
At the moment, due to a logic failsafe to prevent the deletion of current variants, new variants aren't added when more than one new value for a new option is added.
You can add multiple new values to an existing option and it will work, when you had a new option and 1 new value, it will work but subsequent values won't generate.
โ candy tinker
Psy Shell v0.8.18 (PHP 7.1.13 โ cli) by Justin Hileman
>>> config('hashids.connections')
=> [
"main" => [
"salt" => "your-salt-string",
"length" => "your-length-integer",
],
"alternative" => [
"salt" => "your-salt-string",
"length" => "your-length-integer",
],
]
This comes from the vendor/vinkla/hashids/config/hashids.php
file, instead of the candy-api one. This results in errors on multiple api calls on every Hub page:
{
"message": "Connection [channel] not configured.",
"exception": "InvalidArgumentException",
"file": "/Users/askirius/Sites/candy/vendor/graham-campbell/manager/src/AbstractManager.php",
"line": 164,
"trace": [
{
"file": "/Users/askirius/Sites/candy/vendor/graham-campbell/manager/src/AbstractManager.php",
"line": 126,
"function": "getConnectionConfig",
"class": "GrahamCampbell\\Manager\\AbstractManager",
"type": "->"
},
{
"file": "/Users/askirius/Sites/candy/vendor/graham-campbell/manager/src/AbstractManager.php",
"line": 72,
"function": "makeConnection",
"class": "GrahamCampbell\\Manager\\AbstractManager",
"type": "->"
},
{
"file": "/Users/askirius/Sites/candy/vendor/getcandy/candy-api/src/Api/Traits/Hashids.php",
"line": 25,
"function": "connection",
"class": "GrahamCampbell\\Manager\\AbstractManager",
"type": "->"
},
...
GetCandy's hashids.php
should be loaded instead.
I am getting this error after running php artisan candy:install on fresh install where i followed the instructions for candy api and hub.
Moved from getcandy/candy-store#8 by @peaksolutions77
I am getting this error after successful installation.
local.ERROR: Type error: Return value of Vinkla\Hashids\HashidsServiceProvider::registerFactory() must be an instance of Vinkla\Hashids\void, none returned {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Type error: Return value of Vinkla\\Hashids\\HashidsServiceProvider::registerFactory() must be an instance of Vinkla\\Hashids\\void, none returned at /var/www/html/ecommerece/vendor/vinkla/hashids/src/HashidsServiceProvider.php:81)
Please help me out.
candy install command not working .
thanks
I am getting this error when using "api/v1/search" API. My code is fork from "getcandy/candy-api/tree/dev", using ElasticSearch 6.4.2.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.