Subscription
Contains all Requests connected with subscriptions
Table of Contents
Methods
cancelSubscription
(
Object
-
unsubscribeUrl
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
(
Object
-
data
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
(
Object
-
id
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
(
Object
-
page
-
limit
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));