2017 © Pedro Peláez
 

library merchium-sdk

Merchium PHP SDK

image

merchium/merchium-sdk

Merchium PHP SDK

  • Friday, November 25, 2016
  • by vsguts
  • Repository
  • 13 Watchers
  • 15 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Merchium PHP SDK

Hello and welcome to Merchium PHP SDK, a Merchium app development toolkit for PHP developers., (*1)

Merchium PHP SDK consists of the MerchiumClient.php PHP library and an example app (see it described in the docs)., (*2)

MerchiumClient.php

Use the MerchiumClient.php library to interact with the Merchium REST API. The library contains a single class MerchiumClient which offers methods for API interaction., (*3)

You can find the current library version in the MerchiumClient::LIB_VERSION constant., (*4)

The MerchiumClient Class Methods

  1. __construct($app_key, $shared_secret, $shop_domain = '', $access_token = '')—class constructor., (*5)

  2. setAccessToken($shop_domain)—set the API access token value., (*6)

    • $shop_domain—unique store domain at mymerchium.com (e.g. mystore.mymerchium.com).
  3. setShopDomain($access_token)—set the store domain value., (*7)

    • $access_token—API access token.
  4. getInstallationUrl($scope, $redirect_uri = '')—get the app installation link (see Authorization. AccessToken). Normally, you don't need to call this method manually, because the Marketplace generates the link itself., (*8)

    • $scope—permission scope list.
    • $redirect_uri—post-install redirect URI .
  5. requestAccessToken($code)—send a request to get an API access token., (*9)

  6. getRequest($path, $params)—send a request to get object data., (*10)

    • $path—path to the object, i.e. part of the URL after http://STORE_NAME.mymerchium.com/api/.
    • $params—request params.
  7. createRequest($path, $params)—send a request to create an object., (*11)

    • $path—path to the object, i.e. part of the URL after http://STORE_NAME.mymerchium.com/api/.
    • $params—request params.
  8. updateRequest($path, $params)—send a request to update object data., (*12)

    • $path—path to the object, i.e. part of the URL after http://STORE_NAME.mymerchium.com/api/.
    • $params—request params.
  9. deleteRequest($path)—send a request to delete an object., (*13)

    • $path—path to the object, i.e. part of the URL after http://STORE_NAME.mymerchium.com/api/.
  10. testRequest()—send a test request, e.g. to check the connection., (*14)

  11. validateSignature($get)—validate the signature of an incoming request (see Authorization. AccessToken)., (*15)

    • $get—request params, usually a $_GET array.
  12. getLastErrorStatus()—get the last error code from the API response. See Error Codes., (*16)

  13. getLastError()—get the last error message from the API response. See Error Codes., (*17)

Errors Returned by the API

See Error Codes., (*18)

Errors Returned by the Library

  • Curl PHP module not found—the curl PHP extension not found.
  • Сurl error(CODE): ERROR—errors returned by the curl extension.
  • Could not JSON-encode the request data—error during JSON encoding.
  • Could not JSON-decode the response—error during deconding of the server returned JSON data.
  • Empty response—empty response from the server.

The Versions

25/11 2016

dev-master

9999999-dev http://apps.merchium.com/

Merchium PHP SDK

  Sources   Download

Merchium Platform

The Requires

  • lib-curl *
  • php >=5.3.0

 

sdk merchium

24/09 2015

v1.0.2

1.0.2.0 http://apps.merchium.com/

Merchium PHP SDK

  Sources   Download

Merchium Platform

The Requires

  • lib-curl *
  • php >=5.3.0

 

sdk merchium

15/05 2015

v1.0.1

1.0.1.0 http://apps.merchium.com/

Merchium PHP SDK

  Sources   Download

Merchium Platform

The Requires

  • lib-curl *
  • php >=5.3.0

 

sdk merchium

15/05 2015

v0.9.9

0.9.9.0 http://apps.merchium.com/

Merchium PHP SDK

  Sources   Download

Merchium Platform

The Requires

  • lib-curl *
  • php >=5.3.0

 

sdk merchium