WhitelabelPay

Properties

Link copied to clipboard

The number of tokens available in the local storage.

Link copied to clipboard
abstract val state: StateFlow<State>

Property that reflects the current state of the SDK.

Link copied to clipboard
abstract val token: StateFlow<Token?>

Property that provides a token depending on the current state of the SDK.

Functions

Link copied to clipboard
abstract suspend fun deactivatePaymentMean(paymentMeanId: UUID, onDeactivationSuccess: () -> Unit)

Deactivate an active payment means, calling this func will ask the server to deactivate the payment means. It will also delete all payment tokens for the payment mean.

Link copied to clipboard
abstract suspend fun deletePaymentMean(paymentMeanId: UUID, onDeletionSuccess: () -> Unit)

Function to delete a payment mean. Deleting an active mean will result in deleting all it's payment tokens as well.

Link copied to clipboard
abstract fun deviceState(): State

Provides the status of the device State locally saved in the storage.

Link copied to clipboard
abstract fun getEnrolmentToken(): Token

Provides an enrolment token Token.Enrolment to enroll a card in WhitelabelPay.

Link copied to clipboard
abstract suspend fun getPaymentMeansList(): List<PaymentMean>

Provides the list of payment means PaymentMean. The list consists of active and also inactive payment means. Deleted payment means won't be displayed in this list.

Link copied to clipboard
abstract suspend fun getPayments(page: Int = 0, sortQuery: String?, status: TransactionStatus? = null): PaymentsOverview

Function to retrieve the payments history overview

Link copied to clipboard
abstract suspend fun getPaymentToken(): Token?

Provides a signed payment token Token.Payment from White Label Pay. The Token.Payment.signedToken is the signed token representation required to make a successful payment transaction.

Link copied to clipboard
abstract suspend fun handleNotification(eventType: String?, eventBody: String?)

Function to pass a received the notification data payload instance to the SDK in order to adjust the SDK state accordingly. This function should be called from FirebaseMessagingService.onMessageReceived(remoteMessage: RemoteMessage)

Link copied to clipboard
abstract suspend fun reactivatePaymentMean(paymentMeanId: UUID, onReactivationSuccess: () -> Unit)

Calling this method will reactivate a deactivated payment mean.

Link copied to clipboard
abstract fun reset()

Function to purge all SDK data. This will effectively reset the SDK for a clean start.

Link copied to clipboard
abstract fun setNotificationId(notificationId: String)
Link copied to clipboard
abstract suspend fun signOff(onSignOffSuccess: () -> Unit)

Calling this method will delete all user specific data, including payment means, payment tokens, enrolment token and signing keys.

Link copied to clipboard
abstract suspend fun sync(): State

Sync the local SDK state with the backend. Should be called whenever appropriate to have the SDK in a synced state.