Show:

Contains all Requests connected with subscriptions

Methods

cancelSubscription
(
  • unsubscribeUrl
)
Object
async

Cancels a subscription

Parameters:

  • unsubscribeUrl String
    • The url for the subscription which is getting unsubscribed

Returns:

Object

Example:

InPlayer.Subscription
.cancelSubscription('abcdef')
.then(data => console.log(data));
create
(
  • data
)
Object
async

Subscribes to a given asset. Use this method ONLY if the accessFee.type === 'subscription'. Otherwise please use InPlayer.Payment.payForAsset()

Parameters:

  • data Object
    • { number: number, cardName: string, expMonth: number, expYear: number, cvv: number, accessFee: number, paymentMethod: string, referrer: string, voucherCode?: string, brandingId?: number, returnUrl?: string }

Returns:

Object

Example:

InPlayer.Subscription
.create({
     number: 1,
     cardName: 'Payoneer',
     expMonth: 11,
     expYear: 12,
     cvv: 546,
     accessFee: 13.4,
     paymentMethod: 'card',
     referrer: 'http://localhost:3000',
     voucherCode: '123123125914i2erjfg',
     brandingId?: 1234,
     returnUrl?: 'https://event.inplayer.com/staging',
   }
)
.then(data => console.log(data));
getSubscription
(
  • id
)
Object
async

Get subscription details for a given user by id

Parameters:

  • id String
    • The subscription id

Returns:

Object

Example:

InPlayer.Subscription
.getSubscription('abcdef')
.then(data => console.log(data));
getSubscriptions
(
  • page
  • limit
)
Object
async

Gets all subscriptions for a given user

Parameters:

  • page Number
    • The current page
  • limit Number
    • The number of items per page

Returns:

Object

Example:

InPlayer.Subscription
.getSubscriptions()
.then(data => console.log(data));