Giter Club home page Giter Club logo

pos-shopify-extension's Introduction

POS Shopify Extension

Getting started

Requirements

  1. You must download and install Node.js if you don't already have it.
  2. I would recommend Visual Studio Code for programming

Installation

  1. Fork this repository
  2. Clone the fork
  3. Run npm install

Working from the remote

  1. Always create a new branch before starting a feature
  2. Commit your changes
  3. Run git checkout main
  4. Run git pull upstream main --rebase and git push origin main (if doesn't work, run git push origin main --force)
  5. Switch to your feature branch (git checkout [branch-name]) and run git rebase main
  6. Now, you can push to your origin (git push origin main) and go to this repo and create a PR

Setting up Shopify

  1. Create a Shopify Partners account
  2. Send me the email address you used on Slack (Krithin Jay)

Get help

Tech Stack

This app combines a number of third party open-source tools:

The following Shopify tools complement these third-party tools to ease app development:

  • Shopify API library adds OAuth to the Express backend. This lets users install the app and grant scope permissions.
  • App Bridge React adds authentication to API requests in the frontend and renders components outside of the App’s iFrame.
  • Polaris React is a powerful design system and component library that helps developers build high quality, consistent experiences for Shopify merchants.
  • Custom hooks make authenticated requests to the Admin API.
  • File-based routing makes creating new pages easier.
  • @shopify/i18next-shopify is a plugin for i18next that allows translation files to follow the same JSON schema used by Shopify app extensions and themes.

User Roles:

  • Merchant (admin): Backend user of Shopify customizing the checkout process and adding items to the online store.
  • Prerequisite (Merchant): Needs to have a designated wallet handle with tokens inside. Or create a new wallet in the app.

Users Defined:

  • Consumer: Person buying something on Shop owners (Merchants) Shopify instance
  • Prerequisite (consumer): Needs to go through the cart checkout process and finalize a purchase. Either has an existing wallet (enter wallet name) or gets assigned a new wallet (could be the email address)

Wallets Defined:

  • Greenstand Shopify Master Wallet: This is the master wallet created on the Greenstand wallet system that enables the shopify App to create more wallets and create trust relationships to receive tokens from the wallet of the shop owner.

  • Consumer Wallet: A wallet created by the Shopify App (Using the Greenstand Shopify Master Wallet above). This wallet is created with a “trust relationship” that enables the wallet to receive tokens from the shop owner’s wallet. Complication: If the consumer already has created an outside of the shopify app, a new relationship must be established and a trust relationship must be sent (later user stories).

  • Merchant Shop Wallet: This is a wallet that is owned by the merchant and designated as the wallet to draw tokens from on the shop.

Use case:

Consumers buy items in the store and on check out opt in to receive tokens. If no wallet is known a new wallet gets created. The wallet created is fully managed by the Greenstand master account and only has a trust relationship to the “merchants master wallet”. That way tokens can not be transferred back into the merchant's master wallet which increases trust and security.

pos-shopify-extension's People

Contributors

suspensefallback avatar dependabot[bot] avatar davidezrajay avatar vinayakg311 avatar xlpeng57 avatar

Stargazers

 avatar

Watchers

zaven avatar Sebastian Gärtner avatar Dadiorchen avatar EMMANUEL avatar  avatar  avatar

pos-shopify-extension's Issues

Add Wallet Authentication for Admin Wallet

API issue

We need to add wallet authentication on the API

Expected behaviour

  • Connects wallet so that we can create wallets, connect tokens, etc.

Need help?

  • Ask over here
  • Look at the Shopify documentation
  • Message Krithin Jay on Slack

PUT - Accept token transfer

API issue

MVP version: v0
CRUD type: PUT

  • Accept token transfer from Linked Greenstand wallet

Expected behaviour

  • Accept token transfer

Need help?

  • Ask over here!
  • Look at the Shopify documentation!
  • Message Krithin Jay on Slack!

Add wallet connection for merchants

API issue

We need to be able to allow merchants to connect a pre-existing wallet.

Expected behaviour

  • Sends requests to treetracker-wallet-api
  • Successfully connects wallet
  • Handles authentication (this might be a little difficult)
  • Gracefully handles errors

Need help?

  • Ask over here
  • Look at the Shopify documentation
  • Message Krithin Jay on Slack

Safely store secret keys

What is the issue?

Shopify Apps require extreme security, especially when billing is involved.

One part of this is for all secrets to be stored safely and securely.

Here, we will talk about security issues.

API Documentation

API Documentation

We need API Documentation for newcomers to be able to easily understand the APIs, and for people who are coming back to the project after a while.

Wallet creation for shoppers

What is the issue?

If shoppers choose to do so, they should be able to create/connect a wallet where they can store their Impact Tokens.

Where should this go?

Not exactly sure yet, probably on a link from the checkout page.

Need help?

  • Read the Shopify Documentation
  • Ask Krithin Jay on Slack
  • Post comments here

Can't let user go ahead - extension

Describe the bug

There is no button to go to the next step in the extension

Additional context

We need a button that will let the user go ahead.

Need help?

  • Comment down here
  • Comment in the discussions
  • Message Krithin Jay on Slack

Customise checkout using post-purchase UI extensions

Customising checkout

Description:

Merchant perspective:

As a Shopify merchant, I want to be able to add a section to my checkout page so that I can facilitate the transfer of tokens from my account to my client’s wallets. logged-in wallet admin user, I want to be able to send token to other managed wallets.

Shopper perspective:

As a shopper, I want to be able to get tokens for my purchases.

Acceptance Criteria:

  • The page should inform the user of the ongoing offer on tokens.
  • The page should have a checkbox that allows the shopper to opt in to the program.
  • The page should have a button to be able to create a wallet for the shopper.
  • Creating a wallet for the user should be as fast and efficient as possible to increase shopper conversion rates on the offer.
  • The shopper should be able to choose the location of tree planters/specific tree planters that they want to support.

Implementation

This can be done using Shopify Post-purchase UI extensions.

Be able to connect wallet to Shopify extension for merchants

Connecting wallet for merchants

Description: As a Shopify user, I want to be able to connect my existing wallet so that I can buy tokens (recharge) and sell them to my clients.

Acceptance Criteria:

  1. There should be a connect wallet button on the wallet page
  2. The button should lead to a form
  3. The form should have 2 input fields: one for the wallet ID and one for the password
  4. There should be a “Connect” button that is disabled until both fields are filled, and sends a request to the Greenstand servers when clicked
  5. If the details are incorrect, an error message in red should show up below the inputs, explaining that the details are incorrect
  6. Any other errors should be gracefully handled with an error message and guidance to “come back later” or to send a complaint to Greenstand.
  7. If the user enters valid credentials, it should redirect them to the wallet page where the page should have changed to show the wallet ID, the number of tokens, and allow for tokens to be bought.
  8. The page should contain a note explaining how to create a new wallet externally (without using the extension to create one).

Current release: In development.

Attached image: None.

Checkout POST/PUT endpoint API

API issue

To change the current checkout settings/details.

CRUD Type: Create/Update
Endpoint: /api/save-checkout-details

Expected behaviour

  • Should update current checkout settings.
  • Should return any errors.

Need help?

  • Ask over here
  • Look at the Shopify documentation
  • Message Krithin Jay on Slack

Get session token in post-purchase to make API requests

Describe the bug

I can't send requests to the backend.

To Reproduce

Steps to reproduce the behavior:

  1. Clone repo
  2. Run app
  3. Run the extension
  4. Make a test purchase
  5. Enter a test wallet name
  6. Click 'Create wallet'
  7. Check the console logs

Expected behavior

The API functions properly?

Screenshots

None.

Desktop (please complete the following information):

  • OS: MacOS Sonoma
  • Browser: Brave

Additional context

The API logs something saying Invalid API token. The console logs say something else.

These pages should be helpful:

Need help?

  • Comment down here
  • Comment in the discussions
  • Message Krithin Jay on Slack

Add tests for Github

We need to make sure that the code runs properly before merging pull requests.

What tests should be there?

  • Run npm ci (clean-install)
  • Run app to make sure there are no errors

Allow merchant to buy tokens from Greenstand wallet

User story

As a merchant, I want a feature built-in to the Shopify extension that allows me to purchase tokens from Greenstand so that I can sell them to my clients.

Requirements

  • Be able to transfer tokens from Greenstand to merchant's wallet
  • Be able to charge merchant for transaction

Add wallet creation feature for merchants

What is the issue?

The merchant needs to be able to create a wallet to buy tokens that are to be sold to clients.

Where should this feature go?

New page from /wallets

Screenshot 2023-10-22 at 8 09 04 PM

At the green 'Create wallet' button

Need help?

Ask here or in Slack.

Design for Homepage

Design for Homepage

We need a design for the home-page of the Shopify Extension.

Where is the homepage?

Screenshot 2023-10-21 at 9 03 51 AM

Home page

What is the issue?

We need a homepage.

User story

As a Shopify merchant, I want to be able to have a home page that introduces me to the app and provides quick navigation so that I can efficiently use the app.

Acceptance criteria

  1. The home page should display the Greenstanddisplay Greenstand logo, as well as an app logo if we have one.
  2. It should have text that guides the user through the app on the first time using it.
  3. The home page should effectively use illustrations as part of the Shopify Illustrations Guidelines (view #13 )
  4. The home page should provide quick navigation access to useful tools.

Current release: In development

Where should this go?

Screenshot 2023-10-24 at 9 27 31 AM

The area highlighted in blue is our homepage. Currently it is almost blank, and we need to add something there which will direct the merchants when they first use it. It will also be used as a kind of 'quick access' panel when the merchant has already connected a wallet.

Illustrations

Shopify has some guidelines for illustrations (view #13 for more information), but the basic rundown is this:

  • They have a set color scheme
  • They can only be used to add useful information or directions that help better guide the user, rather than to fill up blank space

Figma

Need help?

  • Comment down here
  • Ask in the discussions
  • Message Krithin Jay on Slack

Create manager wallet account for API

What is the issue?

We need to create a manager wallet account that can create/delete wallets, transfer tokens, and create trust relationships between wallets.

Security

This feature needs to be very secure, it will severely impact the security of the app as a whole.

New design for post-purchase extension

Post-purchase extension

There are two parts to the extension:

  • Create wallet page
  • Wallet link page

Note: All of these designs need to use these elements
(annoying, yes but there's no other choice)

Create wallet page

Current design:

Screenshot 2024-04-15 at 9 58 50 AM Screenshot 2024-04-15 at 9 59 14 AM

Requirements:

  • There needs to be a message that tells the user that they have received a token from Greenstand and congratulations
  • There needs to be a short explanation of Greenstand, and what happens to the user
  • There is a message that says "Powered by Greenstand"
  • There is a checkbox that says "I opt in/I agree to this program"
  • There is an input to fill in the wallet name
  • Errors are in red text below the input field
  • There are two buttons - One in primary color that says "Create wallet" and one in secondary color that says "No thanks"

Additional information:

  • Is there anything else we might need here?

Wallet link page

Current design:

Screenshot 2024-04-15 at 9 59 07 AM

Requirements:

  • There needs to be a link that brings the user to the wallet
  • There needs to be a button to move on

Additional information:

  • I haven't added much here, is there anything else that would make it look better? (headers, images, etc.)

Shopify Accessibility and Design Guidelines

Accessibility and Desing

This issue will be a container issue for all other issues regarding accessibility.

What is it?

Accessibility refers to how open and free an app is to be used for people all over the world.

This can include:

  • Translations for different languages
  • Screen reader accessibility
  • Color contrast settings
  • Gesture support
  • tabindex in programming

and more.

This is Shopify's official page regarding it: https://shopify.dev/docs/apps/best-practices/accessibility.
Design page: https://shopify.dev/docs/apps/design-guidelines

We need to be following this guideline when we make our pages, or at least making the key features and then adding accessibility before production.

Issues underneath this

Informing the user about the sale

Updating pages to reflect the sale

Update the website to inform the user about the offer.

Description

Merchant perspective:

As a Shopify merchant, I want to be able to inform my users about the offer on tokens so that I can potentially bring in more sales.

Shopper perspective:

As a shopper, I want to be able to know about any ongoing offers so that I can make an informed decision about my purchase.

Acceptance Criteria:

According to the merchant’s settings:

  • The shop can contain a banner/embedded text/toast in the homepage to inform the user of the offer on tokens.
  • The shop can contain a banner/embedded text/toast in the product page to inform the user of the offer.
  • The shop can contain embedded text in the cart to inform the user of the offer.

POST/PUT - Transfer tokens endpoint

API issue

Version: MVP v0

CRUD type: POST/PUT

  • Transfer tokens from Linked Greenstand wallet to consumer wallet

Expected behaviour

  • Tokens are transferred (might need to accept)

Need help?

  • Ask here!
  • Look at the Shopify documentation!
  • Message Krithin Jay on Slack!

Add testing

Testing

This issue will be a kind of container for all of the issues regarding security. We will be adding them here.

Features that require testing

  • Creating wallet
  • Connecting wallet
  • Transferring tokens

Get current API URL from extension

Current dev URL

In the greenstand-token-extension folder, we need the API URL to make calls. However, in development, it keeps changing everytime someone runs the app, and we have to keep copy-pasting the URL into the slot.

Issue

Can someone create a file that has a function called getCurrentUrl, which gets the current url from shopify.app.toml in the root folder?

You can use external dependencies, just list them in the slot when creating a PR.

Translating the text in the Shopify App

What is the issue?

In the frontend, the text needs to be translated using i18n for React.

User story

As a merchant, I want to be able to use the Greenstand Wallet Extension in any language, so that I can freely and accessibly use it.

Target languages

Current target languages:

  • French
  • German
  • Spanish

Translation document

This is the translation document: https://docs.google.com/document/d/1Vzg-mKNldHJuWF9lXf4ttX8jgVr13TR2c7bzs8EhFBM/edit

Get help

Note

Please make sure that the translations are accurate! I suggest using a tool like DeepL for translation, or even better, if you are a native speaker.

Install DeepL: https://www.deepl.com/en/translator

Checkout GET API endpoint

API issue

To get the current checkout settings/details.

CRUD Type: Read
Endpoint: /api/get-checkout-details

Expected behaviour

  • Should return current checkout settings.

Need help?

  • Ask over here
  • Look at the Shopify documentation
  • Message Krithin Jay on Slack

Add wallet creation for merchants API

API issue

We made a wallet creation page, but it needs the API to function properly

Expected behaviour

  • Sends requests to treetracker-wallet-api
  • Creates wallet successfully
  • Handles errors gracefully

Need help?

  • Ask over here
  • Look at the Shopify documentation
  • Message Krithin Jay on Slack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.