Allow users to acquire paid or free contents

In this section, we explain how to manage your user transactions with the SDK.

This feature is only available for your authenticated users. Please visit the authentication feature specification before trying to implement it

Feature specification

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
import { STTransaction } from "../../models/transaction";
export interface ISTTransactionsSDK {
/**
* List transactions
*/
getTransactions(): Promise<Array<STTransaction>>;
/**
* Create transaction
* @param transactionToCreate
*/
createTransaction(transactionToCreate: STTransaction): Promise<STTransaction>;
}

The transactions feature allow your user to acquire paying (catalog referenced) or free (not catalog referenced) contents.

Making a transaction on a content will remove all related wished content / element from the user wish list.

Examples

List user transactions

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
const transactionList = await staytunedSDK.STTransactions.getTransactions();

Create user transaction

Android
iOS
Web
Android

Coming soon

iOS

Coming soon

Web
/*
* If the content is a paying one, precise the content payment type to use the corresponding wallet
* Otherwise don't fill paymentType (it will be ignored)
*/
const createdTransaction = await staytunedSDK.STTransactions.createTransaction({
contentKey: 'a-content-key', // Can be a content key
elementKey: 'an-element-key', // Or an element Key
paymentType: 'staytuned-credit',
});

A transaction can be linked to a content OR an element but never both (will result in the transaction to not be created)