BNMetrics / Laravel-ShopifyAPI

Shopify Laravel API Wrapper ( with Billing support!)
MIT License
53 stars 30 forks source link

Client error: `POST https://micha-3.myshopify.com//admin/oauth/access_token` resulted in a `400 Bad Request` response: {"error":"invalid_request"} #15

Open ate090913 opened 6 years ago

ate090913 commented 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"}

kumar1010sumit commented 5 years ago

I m facing same issue.

TomJacobsUK commented 5 years ago

Check the pull request I've just made https://github.com/BNMetrics/Laravel-ShopifyAPI/pull/17 it should fix the issue.