AbstractPurchaseService

AbstractPurchaseService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Mixes: MServiceCache
Service:

AbstractPurchaseService()

The PurchaseService exposes the purchase API for VOD, SVOD and PayTV.

getOffers([options]) ⇒ Promise.<Array>

Get a list of available offers : -> If we have a contentId in parameter : the function return all the available offers, including this content -> Otherwise : the function return all available offers structure

Kind: instance method of AbstractPurchaseService
Returns: Promise.<Array> - A list of models

ParamTypeDescription
[options]object
[options.contentId]String

the contentId

[options.filters]number

possible values : byType, isPurchased, orderByPrice

getMyOffers([options]) ⇒ Promise.<Array>

Get a list of all available offers purchased by the current user.

Kind: instance method of AbstractPurchaseService
Returns: Promise.<Array> - A list of models

ParamTypeDescription
[options]object
[options.filters]number

possible values : byType, isPurchased, orderByPrice

getMedia(offer, content, options) ⇒ *

Get the media associated to the offer

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerAbstractOffer

the offer

contentAbstractContent

the content

optionsobject

additional options

getOfferDetail(offerId) ⇒ Promise.<AbstractOffer>

Get detail of the offer in parameter.

Kind: instance method of AbstractPurchaseService
Returns: Promise.<AbstractOffer> - detail of the offer null if the offer does not exist

ParamTypeDescription
offerIdnumber

Id of the offer

purchase(offerId, options) ⇒ Promise.<string>

Purchase the offer in parameter.

Kind: instance method of AbstractPurchaseService
Returns: Promise.<string> - entitlementId the entitlementId

ParamTypeDescription
offerIdnumber

Id of the offer

optionsObject

additional options

options.offerTypeOfferTypes

@see OfferTypes

cancelPurchase(offerId) ⇒ *

Cancel purchase of the offer in parameter.

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerIdnumber

Id of the offer

confirmWatch(media, [options]) ⇒ *

Confirm that the purchased media is being watched Some operators want to be sure that the user has started watching their video before charging the customer

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
mediaAbstractMedia

The media being watched

[options]Object

Additional options

getOfferActivationStatus(offerId) ⇒ Promise.<OfferActivationStatus>

Return the status of the offer in parameter. Lets you know if the rights have been updated after a purchase.

Kind: instance method of AbstractPurchaseService
Returns: Promise.<OfferActivationStatus> - the status of the offer

ParamTypeDescription
offerIdnumber

Id of the offer

isPaymentByCardAvailable([options]) ⇒ Promise.<*>

Return Boolean to know if payment by card (prepayment card) is available

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
[options]object

Additional options

_getOffers([options]) ⇒ *

Vendor implementation for getOffers function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
[options]object
[options.contentId]String

the contentId

[options.filters]number

possible values : byType, isPurchased, orderByPrice

_getMyOffers([options]) ⇒ *

Vendor implementation for getMyOffers function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
[options]object
[options.filters]number

possible values : byType, isPurchased, orderByPrice

_getOfferDetail(offerId) ⇒ *

Vendor implementation for getOfferDetail function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerIdnumber

Id of the offer

_purchase(offerId, options) ⇒ *

Vendor implementation for purchase function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerIdnumber

Id of the offer

optionsObject

additional options

options.offerTypeOfferTypes

@see OfferTypes

_cancelPurchase(offerId) ⇒ *

Vendor implementation for cancelPurchase function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerIdnumber

Id of the offer

_confirmWatch(media, [options]) ⇒ *

Vendor implementation to confirm the watch of the purchase

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
mediaAbstractMedia

The media being watched

[options]Object

Additional options

_getMedia(offer, content, options) ⇒ *

Vendor implementation to get the media

Kind: instance abstract method of AbstractPurchaseService

ParamTypeDescription
offerAbstractOffer

the offer

contentAbstractContent

the content

optionsobject

additional options

_getOfferActivationStatus(offerId) ⇒ *

Vendor implementation for getOfferStatus function

Kind: instance method of AbstractPurchaseService

ParamTypeDescription
offerIdnumber

Id of the offer

“purchaseComplete” (offerId)

Fired when a purchase is made

Kind: event emitted by AbstractPurchaseService

ParamTypeDescription
offerIdString

offer being purchased

“purchaseCancel” (offerId)

Fired when a purchase is cancelled

Kind: event emitted by AbstractPurchaseService

ParamTypeDescription
offerIdString

offer being cancelled