Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
353 stars 102 forks source link

[API] Invalid API key or access token (unrecognized login or wrong password) #189

Closed malikhammad12 closed 1 year ago

malikhammad12 commented 1 year ago

When i hit my billing url, then error the following error comes....For bug reporting only! If you're posting a feature request or discussion, please ignore.

Working on "kyon147/laravel-shopify": "^19.0", error network

    "laravel/framework": "^10.10"

This is my code of billing url....

Expected Behavior

Please describe the behavior you are expecting.

Current Behavior

Please describe the current behavior?

Failure Information

Please help provide information about the failure if this is a bug.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Step 1
  2. Step 2
  3. ...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

Kyon147 commented 1 year ago

That error is telling you the potential issue, your API credentials are not correct or your api scopes are not right.

Going to close this until you have more information as the screenshot is too vague.

ivanjanev commented 1 year ago

I'll try to add more detail since I'm experiencing the same issue.

Variables overwritten in .env file:

SHOPIFY_API_VERSION="2023-07"
SHOPIFY_API_KEY="bf*********************7e"
SHOPIFY_API_SECRET="ce**********************77"
SHOPIFY_APP_NAME="Codeart Faker"

My web.php file

<?php

use App\Http\Controllers\FakerController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', FakerController::class)->middleware(['verify.shopify'])->name('home');

The FakerController.php file

<?php

namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class FakerController extends Controller
{
    /**
     * Handle the incoming request.
     */
    public function __invoke(Request $request)
    {
        /**
         * @var $shop User
         */
        $shop = Auth::user();
        $request = $shop->api()->rest('GET', '/admin/products.json');
        echo $request['body'];
    }
}

Screenshot from within my development store image

EDIT I just ran the same settings on Laravel v9.52.14 and everything works perfectly.

Asenwang commented 10 months ago

When you use "laravel/framework": "^10.10", you should remove as below In User Model image