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

plasma-membership-api-client-js

Package Overview
Dependencies
Maintainers
11
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plasma-membership-api-client-js

Memberships API JS client

  • 1.0.28
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created
Source

Memberships

Kind: global class

new Memberships()

Memberships API JS client.

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

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

memberships.getMembershipGroups(params) ⇒ Array

Return list of membership groups.

Kind: instance method of Memberships
Returns: Array -

[
{
"id":"1",
"name":"Name",
"active_icon":"http://s3.amazonaws.com/doc/2017-02-02/",
"inactive_icon":"http://s3.amazonaws.com/doc/2017-02-02/",
"type_id":"17763",
}, ...]

ParamTypeDescription
paramsObjectMembership groups parameters
   {    type_id: Number   } 

memberships.getMemberships(params) ⇒ Array

Return list of all membership plans.

Kind: instance method of Memberships
Returns: Array -

[
{
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
}, ...]

ParamTypeDescription
paramsObjectMembership group parameters
   {    group_id: Number   } 

memberships.getMembership(params) ⇒ Array

Return membership plan by id.

Kind: instance method of Memberships
Returns: Array -


{
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
}

ParamTypeDescription
paramsnumberid

memberships.getListOfSubscriptions(token, params) ⇒ Array

Return list of subscriptions .

Kind: instance method of Memberships
Returns: Array -

[
{
"id":"1",
"membership": {
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
},
"user_id":"12345",
"status":"active"
"end_date":"1038444",
"downloads":"0",
"downloads_quota": 100,
}, ...]

ParamTypeDescription
tokenStringUser token
paramsObjectMembership groups parameters
   {    status : String,    membership_id : Number,    group_id : Number   } 

memberships.getSubscription(token, id) ⇒ Object

Return subscription .

Kind: instance method of Memberships
Returns: Object -

{
"id":"1",
"membership": {
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
},
"user_id":"12345",
"status":"active"
"end_date":"1038444",
"downloads":"0",
"downloads_quota": 100,
}

ParamTypeDescription
tokenStringUser token
idNumberUser id

memberships.reactivatePayments(token, id) ⇒ Object

Reactivate payments

Kind: instance method of Memberships
Returns: Object -

{
"id":"1",
"membership": {
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
},
"user_id":"12345",
"status":"active"
"end_date":"1038444",
"downloads":"0",
"downloads_quota": 100,
"payment_status": active,
}

ParamTypeDescription
tokenStringUser token
idNumberMembership subscription id

memberships.suspendPayments(token, id) ⇒ Object

Suspend payments

Kind: instance method of Memberships
Returns: Object -

{
"id":"1",
"membership": {
"id":"1",
"title":"Premium",
"descriptions":"Example description",
"group_id":"1",
"price": 199,
"max_downloads":"10",
"duration_days":"30",
},
"user_id":"12345",
"status":"active"
"end_date":"1038444",
"downloads":"0",
"downloads_quota": 100,
"payment_status": active,
}

ParamTypeDescription
tokenStringUser token
idNumberMembership subscription id

memberships.getListOfDownloads(token, id) ⇒ Object

Return list of downloads.

Kind: instance method of Memberships
Returns: Object -

{
"currentPageIndex":1,
"totalCount":11,
"lastPageIndex":6,
"items": [
{
"id":"1",
"product_id":"143142",
"created_at":"12345"
}, ...]
}

ParamTypeDescription
tokenStringUser token
idNumberProduct id

memberships._isValidId(id) ⇒ Bool

Return Correct id or not

Kind: instance method of Memberships

ParamTypeDescription
idNumberProduct id

memberships._fetchRequest(url, token, method, params) ⇒ Promise

Return Fetch Promise

Kind: instance method of Memberships

ParamTypeDescription
urlStringWhere request go
tokenStringauth user token
methodStringrequest method must be uppercase, default 'GET'
paramsObjectrequest params object

FAQs

Package last updated on 11 Apr 2018

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