Преглед изворни кода

fix: correct ShopRenter EntryPoint URL format #37

- Remove invalid {installation_id} template syntax from EntryPoint URL
- EntryPoint should be static HTTPS endpoint without placeholders
- ShopRenter populates app_url parameter, which our backend uses for redirect
- Updated documentation in SHOPRENTER.md, SHOPRENTER_REGISTRATION.md, and DEPLOYMENT_GUIDE.md
- Verified all ShopRenter Edge Functions are live and working correctly
Claude пре 5 месеци
родитељ
комит
f342fd8ee4
3 измењених фајлова са 10 додато и 7 уклоњено
  1. 2 1
      DEPLOYMENT_GUIDE.md
  2. 5 4
      SHOPRENTER.md
  3. 3 2
      SHOPRENTER_REGISTRATION.md

+ 2 - 1
DEPLOYMENT_GUIDE.md

@@ -218,11 +218,12 @@ No special configuration needed. The OAuth flow is initiated from the dashboard.
 
 
 1. Register your app with ShopRenter by emailing partnersupport@shoprenter.hu with:
 1. Register your app with ShopRenter by emailing partnersupport@shoprenter.hu with:
    - **Application Name**: ShopCall.ai - AI Phone Assistant
    - **Application Name**: ShopCall.ai - AI Phone Assistant
-   - **EntryPoint URL**: `https://yourdomain.com/integrations?sr_install=...`
+   - **EntryPoint URL**: `https://yourdomain.com/integrations`
    - **RedirectUri URL**: `https://YOUR_PROJECT.supabase.co/functions/v1/oauth-shoprenter-callback`
    - **RedirectUri URL**: `https://YOUR_PROJECT.supabase.co/functions/v1/oauth-shoprenter-callback`
    - **UninstallUri URL**: `https://YOUR_PROJECT.supabase.co/functions/v1/webhook-shoprenter-uninstall`
    - **UninstallUri URL**: `https://YOUR_PROJECT.supabase.co/functions/v1/webhook-shoprenter-uninstall`
    - **Application Logo**: 250x150px PNG with transparency
    - **Application Logo**: 250x150px PNG with transparency
    - **Required Scopes**: `product:read`, `product:write`, `customer:read`, `customer:write`, `order:read`, `order:write`, `category:read`, `webhook:read`, `webhook:write`
    - **Required Scopes**: `product:read`, `product:write`, `customer:read`, `customer:write`, `order:read`, `order:write`, `category:read`, `webhook:read`, `webhook:write`
+   - **Note**: EntryPoint URL should be a static HTTPS endpoint. ShopRenter will call it with authentication parameters, and our backend will redirect with the `sr_install` parameter.
 
 
 2. Once approved, you'll receive:
 2. Once approved, you'll receive:
    - **ClientId** (add to `SHOPRENTER_CLIENT_ID`)
    - **ClientId** (add to `SHOPRENTER_CLIENT_ID`)

+ 5 - 4
SHOPRENTER.md

@@ -86,11 +86,12 @@ See `.env.example` files for configuration details.
 
 
 **EntryPoint (HTTPS required):**
 **EntryPoint (HTTPS required):**
 ```
 ```
-https://shopcall.ai/integrations?sr_install={installation_id}
+https://shopcall.ai/integrations
 ```
 ```
 - This is where users land after OAuth installation
 - This is where users land after OAuth installation
-- Must validate HMAC on entry
-- Displays integration success/configuration page
+- ShopRenter will call this URL with authentication parameters: `shopname`, `code`, `timestamp`, `hmac`, `app_url`
+- Our backend redirects to `app_url` (provided by ShopRenter) with `sr_install` parameter
+- Frontend displays integration success/configuration page
 
 
 **RedirectUri (HTTPS required):**
 **RedirectUri (HTTPS required):**
 ```
 ```
@@ -581,7 +582,7 @@ const config = {
 
 
   // Production endpoints
   // Production endpoints
   redirectUri: 'https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/oauth-shoprenter-callback',
   redirectUri: 'https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/oauth-shoprenter-callback',
-  entryPoint: 'https://shopcall.ai/integrations?sr_install={installation_id}',
+  entryPoint: 'https://shopcall.ai/integrations',
   uninstallUri: 'https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/webhook-shoprenter-uninstall',
   uninstallUri: 'https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/webhook-shoprenter-uninstall',
 
 
   // Required scopes
   // Required scopes

+ 3 - 2
SHOPRENTER_REGISTRATION.md

@@ -63,10 +63,11 @@ All endpoints use **HTTPS** and include **HMAC validation** for security.
 
 
 ### EntryPoint
 ### EntryPoint
 ```
 ```
-https://shopcall.ai/integrations?sr_install={installation_id}
+https://shopcall.ai/integrations
 ```
 ```
 - This is where users land after successful OAuth installation
 - This is where users land after successful OAuth installation
-- Validates HMAC signature on entry
+- ShopRenter calls this URL with authentication parameters: `shopname`, `code`, `timestamp`, `hmac`, `app_url`
+- Our OAuth callback validates HMAC, exchanges tokens, and redirects to this URL with `sr_install` parameter
 - Displays integration success page and configuration options
 - Displays integration success page and configuration options
 - Users can configure AI assistant settings and phone numbers
 - Users can configure AI assistant settings and phone numbers