oseintow / laravel-shopify Goto Github PK
View Code? Open in Web Editor NEWLaravel Shopify Package
Laravel Shopify Package
Using version ^2.0 for oseintow/laravel-shopify
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- illuminate/support v6.8.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.7.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.6.2 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.6.1 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.6.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.5.2 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.5.1 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.5.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.4.1 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.3.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.2.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.1.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.0.4 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.0.3 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.0.2 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.0.1 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- illuminate/support v6.0.0 requires php ^7.2 -> your PHP version (7.1.33) does not satisfy that requirement.
- oseintow/laravel-shopify v2.0.0 requires illuminate/support ^6.0 -> satisfiable by illuminate/support[v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.2.0, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0].
- Installation request for oseintow/laravel-shopify ^2.0 -> satisfiable by oseintow/laravel-shopify[v2.0.0].
I have been trying to install this dependency on my Laravel 8.0 application, but it fails. You can see here the message of error I'm getting:
Any idea of how can I fix this? I have been looking for a solution on the internet but seems like nobody has had this issue with Laravel 8.0 yet.
I attach the exact log error here:
Problem 1 - Root composer.json requires oseintow/laravel-shopify ^2.0 -> satisfiable by oseintow/laravel-shopify[v2.0.0]. - oseintow/laravel-shopify v2.0.0 requires guzzlehttp/guzzle ^6.2 -> found guzzlehttp/guzzle[6.2.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.2).
Hello, when trying to install it gives the following error due to conflicts. as investigated is why:
The laravel/framework already has illuminate/support
included in the installation.
It gives the following error in console when running composer require oseintow/laravel-shopify
:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires oseintow/laravel-shopify ^2.0 -> satisfiable by oseintow/laravel-shopify[v2.0.0].
- oseintow/laravel-shopify v2.0.0 requires illuminate/support ^6.0 -> found illuminate/support[v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
If I try to install composer require illuminate/support
:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires illuminate/support ^8.39, found illuminate/support[v8.39.0, 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
It would be better if Guzzle's proxy parameter could be modified.
I see from reading lots of docs and confusion you have to supply the shop_name for testing a test shop but when the app goes live how do you get rid of the hard coded app name?
Matt
makeRequest
does the following:
return (is_array($responseBody) && (count($responseBody) > 0)) ? array_shift($responseBody) : $responseBody;
Because of the array_shift
it drops "scope" from the response from "admin/oauth/access_token", which is
{ "access_token": "f85632530bf277ec9ac6f649fc327f17", "scope": "write_orders,read_customers" }
Hi there, just working my way through your repository and noticed your instructions refer to the following:
$redirectUrl = "http://mydomain.com/process_shopify_data";
but then go on to create a route:
Route::get("process_oauth_result",function(\Illuminate\Http\Request $request)
suggest changing the $redirectUrl line to:
$redirectUrl = "http://mydomain.com/process_oauth_result";
According to Shopify documentation (https://help.shopify.com/api/guides/application-proxies) "Security: Calculate a digital signature" the proxy signature can be verified in the same way as "hmac" in requests.
It the code of public function verifyRequest($queryParams)
something seems to be missed and the calculation is not done:
$hmac = $queryParams['hmac'] ?? ''; unset($queryParams['signature'], $queryParams['hmac']);
and 'signature' does not take part in verification.
Can we treat 404 (not found) GET response as an empty string instead of an error?
For example, in my case, I'm using a webhook and find a product to determine if it does exist. Since ShopifyException class always return if error is 400 and above, my webhook tends to fail everytime a product is not existing.
What I would like to get is an empty string rather than returning the ShopifyException class when error 404 triggers.
Is this fair or I am missing something?
Your response is much appreciated.
Thanks,
Reymark
Can you please release master to a tag please? Need those key and secret methods.
Tag a new release for laravel 7 compaitibility
As the recent commit already supports laravel 7, Please tag a release for packagist to have upgrade
@oseintow
im having 400 error request when requesting GET endpoint.
it seems Shopify updated their server. see https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/shopify-api-call-returns-a-http-400-error-with-html-from-google-484157
Hi,
thanks for the package.. im running into one issue though..
here is my post request to update one order to fulfilled state..
$orderFulfillment = Shopify::setShopUrl($retrieveShopifyStore->EndPoint)
->setAccessToken($retrieveShopifyStore->ApiKey)
->post('admin/orders/4333444701/fulfillments.json');
dd($orderFulfillment);
where do i have to add this fulfillment data?
{
"fulfillment": {
"line_items": [
{
"id": 7877024425
}
]
}
}
this does not work:
$orderFulfillment = Shopify::setShopUrl($retrieveShopifyStore->EndPoint)
->setAccessToken($retrieveShopifyStore->ApiKey)
->post('admin/orders/4333444701/fulfillments.json
{
"fulfillment": {
"line_items": [
{
"id": 7877024425
}
]
}
}
');
dd($orderFulfillment);
i would really appreciate if someone can tell me how to pass this into my request.
thanks.
@oseintow do you plan to implement Shopify Billing API?
Similar to this: https://github.com/nozzlegear/shopifysharp#determine-if-a-request-is-authentic
It'd be great if there was a method to use the decomposed query string to calculate whether the request is an authentic one.
This hmac signature is a hash of all query string parameters and your app's secret key so would be really useful to use in a middleware.
After a fresh installation of Laravel 5.4.27 and following the instructions in the README.md file for this package, when I try to access the 'install_shop' route, I get a RuntimeException of 'A facade root has not been set.'.
Also, can you please provide some additional information as to where and when to use the functions verifyRequest() and verifyWebhook()?
Appreciate any help.
I apologize if asking here is wrong.
Do this API wrapper supports Application Proxies?
Does this package not support simple search queries such as admin/customers/search.json?query=email:[email protected]
? Using the package for this query returns a large amount of customers, but when I use the query in Node or in my browser it returns one. What gives?
To verify internally that the request is authorized, I didn't find any option for "nonce" creation and verification.
I want To write Script in Shopify Script Tag When Someone installed the app.
Here Is Th Code Which I Used
Shopify::setShopUrl($shop)->setAccessToken($access_token)->post("admin/script_tags.json", [ "script_tag"=> [ "event"=> "onload", "src"=> "https://xpressrevolution.in/social_share.js" ] ]);
Please Help In That
Shopify API uses a bucket for api limiting and it'd be super super useful to add it automatically to your calls (get, post, put etc) that it automatically sleeps if it gets close. You can use something like this (except this was used with Guzzle pool, so needs change):
// Respect rate limit
$rateLimit = explode('/', $response->getHeader('x-shopify-shop-api-call-limit')[0]);
$volume = intval($rateLimit[0], 10);
$limit = intval($rateLimit[1], 10);
$limitPercentage = ($volume / $limit) * 100;
// Let user know about success
$this->info(sprintf(
'Shopify API use at %0.2f%%',
number_format($limitPercentage)
));
// Throttle sleep
if ($limitPercentage > 70) {
sleep(1);
}
I have used most of the functions from your package and all work great, except webhook.
The result always return empty. Logs "verification failed" message
public function verifyWebhook(Request $request)
{
$data = $request->getContent();
$hmacHeader = $request->server('HTTP_X_SHOPIFY_HMAC_SHA256');
if (Shopify::verifyWebHook($data, $hmacHeader)) {
logger("verification passed");
} else {
logger("verification failed");
}
}
Hi @oseintow
I try to install app from shopify partner account and it show me this error while installing the app: http://i.imgur.com/iVMLUoG.png
My domain is SSL.
Can you please guide me is there anything I'm missing?
Thank You.
I am trying to register a webhook using api
$webhook = Shopify::setShopUrl($shopUrl)->setAccessToken($accessToken)->post("admin/webhooks.json", ['webhook' =>
['topic' => 'orders/create',
'address' => 'https://c024bd9f.ngrok.io/api/uu',
'format' => 'json'
]
]);
print_r($webhook);
output: Illuminate\Support\Collection Object ( [items:protected] => Array ( [id] => 469747493 [address] => http://c024bd9f.ngrok.io/api/uu [topic] => orders/create [created_at] => 2017-09-11T09:26:05-04:00 [updated_at] => 2017-09-11T09:26:05-04:00 [format] => json [fields] => Array ( ) [metafield_namespaces] => Array ( ) ) )
There is no error but I am not able to create the webhook. Please suggest how to do that. Thanks
Edit: Problem solved! It seems it doesn't add webhook in settings->notification->webhook section of shopify but it does register the webhooks.
The share function is no longer available in the service container.
To update we just have to change line 38 to this:
$this->app->singleton('shopify', function($app)
Afterwards everything will work in 5.4
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.