Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Task: PRD-618 - Getting issue details... STATUS

Outline:

We need to make a new shopify plugin for Netcomm. This plugin will be copy of their old plugin. Here are the feature list of old plugins:

eKomi Official Shopify Plugin for NetComm

This plugin will be made with new Shopify Designs (please check eKomi Plugins for reference ) .

Overview:

The plugin will run from the Plugin Dashboard system and serve Shopify as an API.
Research is required to implement the new generation of Shopify plugin which is an Embedded App.

The embedded app is served within the Shopify Admin Dashboard.
The app will provide installation and uninstallation functionality.
The main requirement within the app is to capture Netcomm and or eKomi configuration settings and persist that to a DB.

Affected Resources:

Netcomm and eKomi plugins. Shopify is changing and it will affect our future plugins.
Plugin Dashboard DB schema will be changed and a new table introduced for the plugin config settings.
Plugin Dashboard environment variables will have new variables added to their respective config files: list file changes outside of Plugin. System files.

Timeline:

Order

Title

Link

Start

Finish

Level

1

New Shopify Plugin for Widget Installation.

PRD-618

18/06/2024

18/072024

Parent

1.1

Local Dev Setup & Plugin Dashboard Onboarding.

PRD-642

18/06/2024

Ongoing

Child

1.2

Shopify Onboarding.

PRD-643

18/06/2024

28/072024

Child

1.3

Plugin - Coding - Planning & Unassigned time tracking.

PRD-644

28/06/2024

04/072024

Child

1.4

Plugin - Coding - Installation

PRD-773

04/072024

14/07/2024

Child

1.5

Plugin - Coding - Uninstallation

PRD-774

04/072024

14/07/2024

Child

1.6

Plugin - Coding - Configuration - CRUD

PRD-763

06/07/2024

14/07/2024

Child

1.7

Plugin - Coding - Refactor & Comment & Document

PRD-764

14/07/2024

18/072024

Child

Process:

  1. Requirement Gathering. 

    • Local Dev Setup & Plugin Dashboard Onboarding. PRD-642

    • Shopify Onboarding. PRD-643

  2. Planning & Design. 

    • Plugin - Coding - Planning & Unassigned time tracking. PRD-642

  3. Implementation.

    • Dev setup

      • Local Dev Setup & Plugin Dashboard Onboarding. PRD-642

    • Shopify setup

    • Plugin development

      • Plugin - Coding - Planning & Unassigned time tracking. PRD-642

      • Plugin - Coding - Installation. PRD-773

      • Plugin - Coding - Uninstallation. PRD-774

      • Plugin - Coding - Configuration - CRUD. PRD-763

      • Plugin - Coding - Refactor & Comment & Document. PRD-764

Process Breakdown:

  1. Requirement Gathering:

    • Plugin Dashboard Repo - Local Dev Setup & Research. 

      • Develop overview of system, define system purpose.

    • Shopify Dashboard & Research.

      • Develop overview of Shopify system.

        • Document Shopify requirements.

  2. Planning & Design:
    The plugin is broken down into components, namely:

    1. App install

    2. App uninstall

    3. App Configuration

  3. Implementation:

    1. Local Dev Setup.

      1. Setup environment to develop - environment specifics needed for the repo to work.

    2. Learn Plugin Dashboard system.

      1. Read Plugin documentation.

      2. Read Plugin code as I’m supposed to model off them.

    3. Shopify Setup

      1. Learn what Shopify requires and how to do development with them.
        Shopify PHP - https://github.com/Shopify/shopify-api-php
        https://shopify.dev/docs/apps/launch/app-requirements-checklist
        https://shopify.dev/docs/api/app-bridge
        So based upon our tech stack it seems like we actually just use the PHP library / dependancy to intergrate the app with Shopify.

      2. Shopify app authentication and authorization.
        https://shopify.dev/docs/apps/build/authentication-authorization
        https://shopify.dev/docs/apps/build/authentication-authorization/set-embedded-app-authorization?extension=javascript
        Authentication is the process of verifying the identity of the user or the app. To keep transactions on Shopify’s platform safe and secure, all apps connecting with Shopify APIs must authenticate when making API requests.

        Authorization is the process of giving permissions to apps. When an app user installs a Shopify app they authorize the app, enabling the app to acquire an access token. For example, an app might be authorized to access orders and product data in a store.
        Create a route for starting the OAuth method such as /login. In this route, the Shopify\Auth\OAuth::begin method will be used. The begin method returns a URL that will be used for redirecting the user to the Shopify Authentication screen.To complete the OAuth process, your app needs to validate the callback request made by Shopify after the merchant authorizes your app to access their store data.

        To do that, you can call the Shopify\Auth\OAuth::callback method in the endpoint defined in the redirectPath argument of the begin method.

      3. Shopify - Ngrok.
        In the Shopify ecosystem, embedded apps run in an iframe in a production environment. In order to test the functionality of your app within that context in development, you’re going to want to tunnel what you have running locally to an accessible URL.

    4. Plugin Development:

      1. DB Schema

         TABLE `netcomm_configuration` : 
          `id` int(11) NOT NULL AUTO_INCREMENT,
          `user_id` int(11) DEFAULT NULL,
          `shop_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
          `access_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `app_uninstall_web_hook_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `order_fulfilled_web_hook_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `widget_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `widget_language` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `terms_and_conditions` tinyint(1) NOT NULL DEFAULT '1',
          `instruction` tinyint(1) NOT NULL,
          `shop_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `shop_interface_password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `netcomm_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
          `store_data` longtext COLLATE utf8_unicode_ci,
          `enabled` tinyint(1) NOT NULL DEFAULT 'false',
          `created` datetime NOT NULL,
          `updated` datetime NOT NULL,
          `member_of_netcomm` tinyint(1) NOT NULL DEFAULT 'false',
          `member_of_ekomi` tinyint(1) NOT NULL DEFAULT 'false',
          PRIMARY KEY (`id`),
          UNIQUE KEY `UNIQ_89D23822678D9590` (`shop_url`),
          UNIQUE KEY `UNIQ_89D238224D16C4DD` (`shop_id`),
          UNIQUE KEY `UNIQ_89D23822B6A2DD68` (`access_token`),
          UNIQUE KEY `UNIQ_89D23822A76ED395` (`user_id`),
          CONSTRAINT `FK_89D23822A76ED395` FOREIGN KEY (`user_id`) REFERENCES `fos_user` (`id`)
      2. Install - Process definition:

        1. Install requires registration as an app provider.

        2. Authentication process and Token exchange.

        3. The app registers within Shopify and Customer shop.

        4. Privilege establishment.

        5. Persists to DB.

      3. Uninstall

        1. Authentication process and Token exchange.

        2. The app un-registers within Shopify and Customer shop.

        3. Deletes from DB.
          Link to Uninstall process flow.

      4. Configuration CRUD

        1. Configuration settings. App requires configuring.
          Options are provided to be either an eKomi client or Netcomm or both.

          1. eKomi Client settings:

            1. ShopId

            2. Shop Interface Password

          2. Netcomm Client settings:

            1. NetcommId

        2. App configuration will be persisted in the DB.
          CRUD functionality.
          Link to Configuration process flow.

      5. Refactor / Testing Phase.

      6. Identify issues and refactor

      7. Documentation / Commenting.
        Document Shopify requirements for apps.
        Explain where app meets requirements.
        Comment functions and classes.

  • No labels