POCardTokenizationEventDispatcher

Dispatcher that allows to handle events during card tokenization.

Properties

Link copied to clipboard
abstract val events: SharedFlow<POCardTokenizationEvent>

Allows to subscribe for card tokenization lifecycle events.

Link copied to clipboard

Allows to subscribe for request to choose a preferred scheme that will be used for card tokenization by default. Once you've subscribed it's required to call preferredScheme for each request.

Link copied to clipboard
abstract val processTokenizedCard: SharedFlow<POCard>

Subscribe to additionally process tokenized card before completion. For example to authorize an invoice or assign customer token. Once you've subscribed it's required to call complete after processing.

Link copied to clipboard

Allows to subscribe for request to decide whether the flow should continue or complete after the failure. Once you've subscribed it's required to call shouldContinue for each request to proceed with the card tokenization flow.

Functions

Link copied to clipboard
abstract suspend fun complete(result: ProcessOutResult<Any>)

Notify that processing of tokenized card is complete (e.g. after invoice authorization or assigning of a customer token). Pass the result from respective ProcessOut API. If processing is done by a custom implementation you can pass ProcessOutResult.Success(Unit) or appropriate ProcessOutResult.Failure(...). Calling this method will complete the flow, unless you've subscribed to shouldContinueRequest to decide it on your own in case of failure.

Link copied to clipboard

Allows to provide a preferred scheme that will be used for card tokenization by default. Response must be constructed from request that has been collected by subscribing to preferredSchemeRequest.

Link copied to clipboard

Notifies whether the flow should continue or complete after the failure. Response must be constructed from request that has been collected by subscribing to shouldContinueRequest.