GithubHelp home page GithubHelp logo

opencartapi's Issues

OpenCart 2.1.0.2 API login() fieldname-changes

Changes regarding OpenCart 2.1.0.2

I will list changes as I pass by them in my development if needed. Might take a while.

->login()

  • The fieldname for password changed to key.
  • The response cookie changed to token.

Suggestion: custom() function for interacting with custom functions we add to OpenCart's API Class

Wondered what you thought about this. For example, I extended the OpenCart API on a few installations to include various additional functions based on our needs like 'order/get' (which fetches details of an order).

Might be nice to have a custom function for non-standard API endpoints. For example:

public function custom($url = null, $postData = array()) {
    if (empty($url)) throw new InvalidDataException("URL cannot be empty for Order->custom()");
    if (!is_array($postData) throw new InvalidDataException("postData must be an associative array for Order->custom()");
    if (empty($postData['order_id']) throw new InvalidDataException("postData['order_id'] is required for for Order->custom()");

    $this->curl->setUrl($this->oc->getUrl($url.'&order_id='.$postData['order_id']));
    $this->curl->setData($postData);
    $this->curl->makeRequest();

    return $this->curl->getResponse();
}

You may find this a bit of a rare use-case but it could be useful if OpenCart adds additional endpoints that people need and these bindings aren't updated immediately. Gives us a fallback.

I'd be happy to submit a pull request for this if you're interested.

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.