Open ate090913 opened 6 years ago
I have a private app. I include this at the .env file SHOPIFY_KEY = "your key" SHOPIFY_SECRET= "your secret " SHOPIFY_REDIRECT = " your redirect"
this is my code in my controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use Shopify;
class MyShopifyController extends Controller {
protected $shop = "sample.myshopify.com/"; protected $foo; protected $scopes = ['read_products','read_themes'];
public function getPermission() { $this->foo = Shopify::make($this->shop, $this->scopes); return $this->foo->redirect(); }
public function getResponse(Request $request) { $this->getPermission();
$user = $this->foo->auth()->getUser(); return $this->foo->auth()->get('products.json', ['fields'=>'id,images,title']);
} }
When I navigate my sample/oauth/authorize error occur
Client error: POST https://sample-3.myshopify.com//admin/oauth/access_token resulted in a 400 Bad Request response: {"error":"invalid_request"}
POST https://sample-3.myshopify.com//admin/oauth/access_token
400 Bad Request
I m facing same issue.
Check the pull request I've just made https://github.com/BNMetrics/Laravel-ShopifyAPI/pull/17 it should fix the issue.
I have a private app. I include this at the .env file SHOPIFY_KEY = "your key" SHOPIFY_SECRET= "your secret " SHOPIFY_REDIRECT = " your redirect"
this is my code in my controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use Shopify;
class MyShopifyController extends Controller {
protected $shop = "sample.myshopify.com/"; protected $foo; protected $scopes = ['read_products','read_themes'];
public function getPermission() { $this->foo = Shopify::make($this->shop, $this->scopes); return $this->foo->redirect(); }
public function getResponse(Request $request) { $this->getPermission();
} }
When I navigate my sample/oauth/authorize error occur
Client error:
POST https://sample-3.myshopify.com//admin/oauth/access_token
resulted in a400 Bad Request
response: {"error":"invalid_request"}