diff --git a/_posts/2016-05-24-iframe-api.md b/_posts/2016-05-24-iframe-api.md index 65d4e53..092c5d4 100644 --- a/_posts/2016-05-24-iframe-api.md +++ b/_posts/2016-05-24-iframe-api.md @@ -45,114 +45,136 @@ After the script is executed, a new global `Mergado` variable containing a singl The `Mergado` object has a number of methods which can be used to better your application, improve its usability or overcome any limitations that are the result of strict handling of sandboxed `IFRAME`s by web browsers. - - - - - + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - +
Mergado.openWindow('https://app.mergado.com/', '_self')
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodParametersDescription
MethodParametersDescription
-
Mergado.startDownload(string url)
-
url: Target URL to start download fromA new mini window will be popped up having target URL as its location. The window will be closed - after 10 seconds; until then the target server has time to make a proper response. In this case most - probably in a form of a file download. -
Example
-
Mergado.tellHeight([int heightInPixels])
-
-
Mergado.openWindow(string url)
-
url: Target page URLA new browser window will be opened having the target URL as its location. This window will NOT - automatically close itself. -
- Example: + +
+
Mergado.startDownload(string url)
+
url: Target URL to start download fromA new mini window will be popped up having target URL as its location. The window will be closed + after 10 seconds; until then the target server has time to make a proper response. In this case most + probably in a form of a file download. +
Example
+
Mergado.startDownload('https://app.mergado.com/')
+
+
Mergado.openWindow(
+  string url,
+  string target = '_blank'
+)
+
+ url: Target page URL
+ target: Open URL in new or same browser window. + Possible options are the same as the target attribute for + HTML link +
A new browser window will be opened having the target URL as its location. This window will NOT + automatically close itself. +
Example:
Mergado.openWindow('https://app.mergado.com/')
-
-
Mergado.scrollTo(int topInPixels)
-
topInPixels: Vertical scroll value, relative to app’s - IFRAME viewport. Must be set in pixels. - The browser’s absolute vertical scroll will be calculated automatically. Just set this Y value relative to - your page. -
- Example: -
Mergado.scrollTo(115)
-
-
Mergado.setAppRoute(string fullAppRoute)
-
fullAppRoute: Complete app route e.g. - eshop/1/project/2/help/The fullAppRoute parameter is than via JS method - history.replaceState() apended into mergado URL as - route query string. And if this URL is then invoked, this part is - appended after app URL in IFRAME src attribute. -
- Example:
-
    -
  1. - App calls -
    setAppRoute('eshop/1/project/2/help/')
    -
  2. -
  3. - In Mergado URL is appended -
    ...&route=eshop%2F1%2Fproject%2F2%2Fhelp%2F
    -
  4. -
  5. - If this page is loaded then IFRAME src attribute is created from -
    <your-extension-host>/apps/appname/
    - and query string route parameter -
    eshop/1/project/2/help/
    -
  6. -
-
-
Mergado.tellHeight([int heightInPixels])
-
heightInPixels (optional): Can be set in pixels, - 0 or undefinedDEPRECATED

The wrapper page will set height of app’s viewport - IFRAME to this number of pixels. If no height is passed, it will be - determined automatically.

For newly created apps since Mergado redesign in Spring 2018 this is no - longer necessary, as the app’s iframe spans almost entire browser viewport and uses its own scrolling. -
- Example: -
Mergado.tellHeight(260)
-
+
Mergado.scrollTo(int topInPixels)
+
topInPixels: Vertical scroll value, relative to app’s + IFRAME viewport. Must be set in pixels. + The browser’s absolute vertical scroll will be calculated automatically. Just set this Y value relative to + your page. +
Example:
+
Mergado.scrollTo(115)
+
+
Mergado.setAppRoute(string fullAppRoute)
+
fullAppRoute: Complete app route e.g. + eshop/1/project/2/help/The fullAppRoute parameter is than via JS method + history.replaceState() apended into mergado URL as + route query string. And if this URL is then invoked, this part is + appended after app URL in IFRAME src attribute. +
Example:
+
    +
  1. + App calls +
    setAppRoute('eshop/1/project/2/help/')
    +
  2. +
  3. + In Mergado URL is appended +
    ...&route=eshop%2F1%2Fproject%2F2%2Fhelp%2F
    +
  4. +
  5. + If this page is loaded then IFRAME src attribute is created from +
    <your-extension-host>/apps/appname/
    + and query string route parameter +
    eshop/1/project/2/help/
    +
  6. +
+
+
Mergado.tellHeight([int heightInPixels])
+
heightInPixels (optional): Can be set in pixels, + 0 or undefinedDEPRECATED

The wrapper page will set height of app’s viewport + IFRAME to this number of pixels. If no height is passed, it will be + determined automatically.

For newly created apps since Mergado redesign in Spring 2018 this is no + longer necessary, as the app’s iframe spans almost entire browser viewport and uses its own scrolling. +
Example:
+
Mergado.tellHeight(260)
+
diff --git a/_posts/2016-06-02-app-hooks.md b/_posts/2016-06-02-app-hooks.md index 303ff75..5826cae 100644 --- a/_posts/2016-06-02-app-hooks.md +++ b/_posts/2016-06-02-app-hooks.md @@ -665,7 +665,9 @@ Event hook called when a when a user creates a connection in the e-shop’s keyc ```json { "action": "control.shop.keychain.link_created", - "shop_id": 123 + "shop_id": 123, + "connection_name": "unas.eu", + "user_id": 456 } ``` @@ -684,7 +686,9 @@ Event hook called when a when a user deletes a connection from the e-shop’s ke ```json { "action": "control.shop.keychain.link_deleted", - "shop_id": 123 + "shop_id": 123, + "connection_name": "heureka.cz", + "user_id": 456 } ``` diff --git a/_posts/2021-07-30-additional-integrations.md b/_posts/2021-07-30-additional-integrations.md index 20255ee..31f6bbd 100644 --- a/_posts/2021-07-30-additional-integrations.md +++ b/_posts/2021-07-30-additional-integrations.md @@ -93,3 +93,27 @@ You can use this button/link to lead your users to the URL mentioned above. Mino ```html {{ page.mergadoButtonHtml }} ``` + +## Redirect into Mergado Keychain + +If you require a connection with one of the services in Mergado Keychain and the user hasn't connected to Mergado Keychain +(connection status you can see on this [endpoint](https://api-docs.mergado.com/?api=mergado-api#/Eshops/get_shops__id___connection__validate){:target="_blank"}), +you can redirect from your app to Mergado Keychain to create this connection. + +#### Minimal version +`https://app.mergado.com/go/keychain +?eshopId= +&connection=` + +#### With additional options +``` +https://app.mergado.com/go/keychain +?eshopId= +&connectionName= +&callbackUrl= +``` + +### GET Parameters Explained +- `eshopId`: E-shop ID of the user for which you want to create the connection. +- `connectionName`: Connection name, e.g. `unas.eu`, `heureka.cz`, list of available names is on this [endpoint](https://api-docs.mergado.com/?api=mergado-api#/Eshops/get_shops__id__info_){:target="_blank"}. +- `callbackUrl`: Optional parameter with encoded URL for a possible redirect to this URL after successful connection creation.