Coder Social home page Coder Social logo

store-integrator's Introduction

Store Integrator Package

Goals

  • Allow seamless integrations with popular selling/shopping platforms.

Current Support

  • Ebay (product publishing and rtrieveing, order retrieving and handling)
  • Amazon (initial level)

Configuration

For eBay

The configuration can be passed directly to the eBay SDK before the integrator is composed, or preferably they can be taken from environment variables.

List of variables for eBay

  • EBAY-TRADING-API-VERSION - The version of the eBay API.
  • EBAY-DEV-ID - The Developer ID key. Taken from eBay.
  • EBAY-APP-ID - App ID key, again taken from eBay. Used to identify CloudCart before the users.
  • EBAY-CERT-ID - Another Key taken from eBay.

Usage

Currently the Integrator objects need to be instantiated directly. To reduce complexity the services are grouped in several smaller API wrapper classes, which are then used to compose the main Integrator class.

In future this will be hidden from the end user of the package.

    $integrator = new StoreIntegrator\Factory([
        'ebay' => [
            'userToken' => 'token'
            // more data needed 
        ]
    ]);
    
    $integrator->provider('ebay')->products->getProducts();
    
    $integrator->provider('ebay')->factory->makeShippingService($data = []);
    $integrator->provider('ebay')->factory->makeProduct($data = []);
    $integrator->provider('ebay')->factory->makeProduct($data = []);
   

Added methdos to get user tokens with a few requirements to the application using the package.

Flow;

1 . Get an instance of the eBay provider

    $integrator = new StoreIntegrator\Factory();
    
    $ebay = $integrator->provider('ebay', [ ... ]);
    

2 . Set the RuName of the app (special identificator from eBay for the application)

    $ebay->auth->setRuName($ruName);

3 . Get a special session id from eBay and store it somewhere (e.g. in the session)

    $sessionId = $ebay->auth->getSessionID();
    
    // save the session id

4 . Build a special eBay url to show the user a dialog, where they can agree

    $url = $ebay->auth->buildRedirectUrl($sessionId);

5 . Redirect the user to the built url (or leave it as link on a page somewhere)

6 . If the user agrees eBay redirects them to a predefined url in the application (https is mandatory) (same happens when they do not agree, but for another url)

7 . When the redirect from eBay is received, get the token and save it for future use

    $token = $ebay->auth->getToken($sessionId);
    
    // Save the token

Limitations

  • eBay does not allow variation images for multiple properties. Currently accepts only images on product (parent for variations) level

TODO

Contributors

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.