Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/andy-cywang/account-manager

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/andy-cywang/account-manager

  • v0.0.0-20210224073114-950f346025af
  • Source
  • Go
  • Socket score

Version published
Created
Source

account-manager

A web app backend manages merchant accounts

Tech Stack

  • Database: MongoDB
  • ServeMux: Gorilla
  • Container: Docker

API Documentaton

1. Login

Operations can only be performed after login.

  • URL

    /login

  • Method:

    POST

  • URL Params

    None

  • Data Params

    Required: { username : "admin", password : "admin" }

2 Create Merchant

Create an merchant

  • URL

    /merchant/create

  • Method:

    POST

  • URL Params

    None

  • Data Params

       { 
         logo: string,
         members: map {
           "key": {
               "email": string,
               "name": string
         }
       }
    

3. Get All Merchants

Get all merchants from database.

  • URL

    /merchant/all

  • Method:

    GET

  • URL Params

    None

  • Data Params

    None

4. Add a Memeber to Merchant

Add a memeber to merchant specified by merchant ID

  • URL

    /merchant/member/add

  • Method:

    POST

  • URL Params

    None

  • Data Params

       { 
         "merchantID": string,
         "members": map {
             "key": {
                 "email": string,
                 "name": string
             }
         }
       }
    

5. Update Merchant Member

Update a member from a merchant specified by merchant ID

  • URL

    /merchant/member/update

  • Method:

    PUT

  • URL Params

    None

  • Data Params

       { 
         "merchantID": string,
         "members": map {
             "key": {
                 "email": string,
                 "name": string
             }
         }
       }
    

6. Delete Merchant Member

Delete a member from a merchant specified by merchant ID

  • URL

    /merchant/member/delete

  • Method:

    DELETE

  • URL Params

    None

  • Data Params

       { 
         "merchantID": string,
         "members": map {
             "key": {
                 "email": string,
                 "name": string
             }
         }
       }
    

7. Get Merchant Members

Get all member from a merchant specified by merchant ID

  • URL

    /merchant/member

  • Method:

    GET

  • URL Params

    merchantID

  • Data Params

    None

Update a merchant's logo

  • URL

    /merchant/logo

  • Method:

    PUT

  • URL Params

    None

  • Data Params

       { 
         "merchantID": string,
         "logo": string
       }
    

How to Run

  1. Run docker-compose up. This will bring up the server together with mongo DB.

  2. Login at host:8080/login by given the admin credential username:password - "admin":"admin".

  3. All set, you are now free to make API calls.

FAQs

Package last updated on 24 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc