Socket
Socket
Sign inDemoInstall

plasma-order-api-client-js

Package Overview
Dependencies
20
Maintainers
7
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    plasma-order-api-client-js

Orders API JS client


Version published
Weekly downloads
1
Maintainers
7
Install size
7.61 MB
Created
Weekly downloads
 

Readme

Source

Orders

Kind: global class

  • Orders
    • new Orders()
    • .getListOfUsersOrders(token, params)Array
    • .getOrderById(token, ID)Object
    • .restoreDownloadLink(token, orderID, productID)Object
    • .checkDownloadLink(token, orderID, productID)Object
    • ._isValidId(id)Bool
    • ._fetchRequest(url, token)Promise

new Orders()

Orders API JS client.

In order to use Orders API you should create an instance of this class.

import Orders from "tm-orders-api-client-js";
const products = new Orders ('http://service-orders.dev/api/v2', 'en');

orders.getListOfUsersOrders(token, params) ⇒ Array

Get list of users orders

Kind: instance method of Orders
Returns: Array -

[
{
"affiliate_id": "TM",
"order_id": "NDrMh3S3XvSt0LfbHoWh",
"user_id": "124088",
"date": 1481166873,
"status": 1,
"amount": "138",
"locale": "EN",
"project_id": "0",
"merchantTransactionId": "",
"merchantSystem": "PayPal",
"products": [
{
"id": "52995",
"class": "template",
"price": "89",
"license": "single site",
"products": []
},
{
"id": "53001",
"class": "template",
"price": "75",
"license": "single site",
"products": []
},
{
"id": "55932",
"class": "template",
"price": "11",
"license": "single site",
"products": [],
"name": "PRO Industry PSD Template",
"url": "/psd-templates/pro-industry-psd-template-55932.html",
"type": "PSD Template",
"image": "55932-original.jpg"
}
]
}, ...]

ParamTypeDescription
tokenStringUser token
paramsObjectlist of orders parameters
   {    page: Number,    per-page: Number,    product-type: String,    product-ids: String,    ids: String   } 

orders.getOrderById(token, ID) ⇒ Object

Get Order By ID

Kind: instance method of Orders
Returns: Object -


{
"affiliate_id": "TM",
"order_id": "NDrMh3S3XvSt0LfbHoWh",
"user_id": "124088",
"date": 1481166873,
"status": 1,
"amount": "138",
"locale": "EN",
"project_id": "0",
"merchantTransactionId": "",
"merchantSystem": "PayPal",
"products": [
{
"id": "52995",
"class": "template",
"price": "89",
"license": "single site",
"products": []
},
{
"id": "53001",
"class": "template",
"price": "75",
"license": "single site",
"products": []
},
{
"id": "55932",
"class": "template",
"price": "11",
"license": "single site",
"products": [],
"name": "PRO Industry PSD Template",
"url": "/psd-templates/pro-industry-psd-template-55932.html",
"type": "PSD Template",
"image": "55932-original.jpg"
}
]
}

ParamTypeDescription
tokenStringUser token
IDNumberOrder ID

orders.restoreDownloadLink(token, orderID, productID) ⇒ Object

Restore Download Link

Kind: instance method of Orders
Returns: Object -

{
"orderId": "xdtGS1apwbLKmv9ZXOlV",
"productId": 123,
"link": "http://dddd.ccc/dgdfgdfg",
"downloadStatus": "inZipper",
"isExpired": false,
"rate": 1,
"zipperTime": 1
}

ParamTypeDescription
tokenStringUser token
orderIDNumberOrder ID
productIDNumberProduct ID

orders.checkDownloadLink(token, orderID, productID) ⇒ Object

Check Download Link

Kind: instance method of Orders
Returns: Object -

{
"orderId": "xdtGS1apwbLKmv9ZXOlV",
"productId": 123,
"link": "http://dddd.ccc/dgdfgdfg",
"downloadStatus": "inZipper",
"isExpired": false,
"rate": 1,
"zipperTime": 1
}

ParamTypeDescription
tokenStringUser token
orderIDNumberOrder ID
productIDNumberProduct ID

orders._isValidId(id) ⇒ Bool

Return Correct id or not

Kind: instance method of Orders

ParamTypeDescription
idNumberProduct id

orders._fetchRequest(url, token) ⇒ Promise

Return Fetch Promise

Kind: instance method of Orders

ParamTypeDescription
urlStringWhere request go
tokenStringauth user token

FAQs

Last updated on 04 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc