Class: PCTransactionsManager

PCTransactionsManager

PCSDK Transactions Manager

Methods

(async) decline(user, transaction, password) → {Promise.<string>}

Decline PCTransaction
Parameters:
Name Type Description
user PCUser PCUser object
transaction PCTransaction object PCTransaction to be declined
password string Rutoken password
Throws:
PCError | PCNetError
Returns:
Type
Promise.<string>

(async) getTransaction(user, transactionId) → {Promise.<PCTransaction>}

Get transaction data from PCSDK Server and return PCTransaction
Parameters:
Name Type Description
user PCUser PCUser object
transactionId string Transaction identifier
Throws:
PCError | PCNetError
Returns:
PCTransaction object
Type
Promise.<PCTransaction>

(async) getTransactionBinaryData(user, transaction) → {Promise.<Blob>}

This method is used for transactions which contain binary data. Before calling this method you are supposed to check whether transaction has binary data by invoking PCTransaction#hasBinaryData first. After downloading binary data, the PCTransaction object will be filled with binary data. You can access it through PCTransaction#getStoredBinaryData method.
Calling this method when binary data is already available is not considered to be an error. In this case the method returns a blob of the corresponding mime type.
Parameters:
Name Type Description
user PCUser PCUser object
transaction PCTransaction object PCTransaction for which binary data needs to be downloaded
Throws:
PCError | PCNetError
Returns:
blob of the corresponding mime type.
Type
Promise.<Blob>

(async) getTransactionList(user) → {Promise.<Array.<string>>}

Get list of transactions identifiers from PCSDK Server
Parameters:
Name Type Description
user PCUser PCUser object
Throws:
PCError | PCNetError
Returns:
Type
Promise.<Array.<string>>

(async) sign(user, transaction, password) → {Promise.<string>}

Sing (confirm) PCTransaction
Parameters:
Name Type Description
user PCUser PCUser object
transaction PCTransaction object PCTransaction to be signed
password string Rutoken password
Throws:
PCError | PCNetError
Returns:
Type
Promise.<string>