Hi.
I’m new on developing Shopify Custom App.
-
I have created the custom app as explained in this page .
-
I have installed Laravel on the server as explained in this page.
-
I have installed this library and merged this template.
-
I have created the test shop and could installed the custom app from the shop admin panel into the shop successfully.
-
Next I want to authenticate the shop and there is a route to authenticate the shop in the template as follows:
Route::get('/api/auth', function (Request $request) { $shop = Utils::sanitizeShopDomain($request->query('shop')); // Delete any previously created OAuth sessions that were not completed (don't have an access token) Session::where('shop', $shop)->where('access_token', null)->delete(); return AuthRedirection::redirect($request); }); Route::get('/api/auth/callback', function (Request $request) { $session = OAuth::callback( $request->cookie(), $request->query(), ['App\Lib\CookieHandler', 'saveShopifyCookie'], ); $host = $request->query('host'); $shop = Utils::sanitizeShopDomain($request->query('shop')); $response = Registry::register('/api/webhooks', Topics::APP_UNINSTALLED, $shop, $session->getAccessToken()); if ($response->isSuccess()) { Log::debug("Registered APP_UNINSTALLED webhook for shop $shop"); } else { Log::error( "Failed to register APP_UNINSTALLED webhook for shop $shop with response body: " . print_r($response->getBody(), true) ); } $redirectUrl = Utils::getEmbeddedAppUrl($host); if (Config::get('shopify.billing.required')) { list($hasPayment, $confirmationUrl) = EnsureBilling::check($session, Config::get('shopify.billing')); if (!$hasPayment) { $redirectUrl = $confirmationUrl; } } return redirect($redirectUrl); });But I have no idea how to call this route.
Can anyone let me know how to authenticate or show me the explanation or sample?
Thanks in advance.