We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 284d7c8 + 82c0406 commit 6259d8bCopy full SHA for 6259d8b
lib/ShopifySDK.php
@@ -421,6 +421,28 @@ public static function getApiUrl() {
421
return self::$config['ApiUrl'];
422
}
423
424
+ /**
425
+ * Returns the appropriate URL for the host that should load the embedded app.
426
+ *
427
+ * @param string $host The host value received from Shopify
428
429
+ * @return string
430
+ */
431
+ public static function getEmbeddedAppUrl($host)
432
+ {
433
+ if (empty($host)) {
434
+ throw new SdkException("Host value cannot be empty");
435
+ }
436
+
437
+ $decodedHost = base64_decode($host, true);
438
+ if (!$decodedHost) {
439
+ throw new SdkException("Host was not a valid base64 string");
440
441
442
+ $apiKey = self::$config['ApiKey'];
443
+ return "https://$decodedHost/apps/$apiKey";
444
445
446
/**
447
* Maintain maximum 2 calls per second to the API
448
*
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments