purchase

abstract suspend fun purchase(amount: String, customMetaData: Map<String, String> = emptyMap()): Flow<PurchaseResult<SdkSuccessAnswer.Purchase>>

Initiates a purchase transaction with the specified amount.

Return

Flow emitting a PurchaseResult which can be a PurchaseResult.Success containing SdkSuccessAnswer.Purchase with invoice and receipt details if successful, or a PurchaseResult.Error if the operation fails.

Additionally, the flow can emit intermediate states:

Note: These intermediate states will only be emitted when the communication type is set to CommunicationType.AIDL.

Parameters

amount

The amount of the purchase, in kopecks. For example, 100 == 1 ruble.

customMetaData

A map of key-value pairs containing additional info for the transaction. This metadata is stored along with the transaction and can be used later for searching, filtering.