WhitelabelPayImplementation

Payment tools SDK to enroll into the Payment tools White Label Pay program. After successful enrollment you can read and use payment tokens. Public-private key pair, device id, enrollment and payment tokens are stored in an encrypted shared preferences file.

Parameters

context

Application context

configs

Configuration object filled from merchant side

Constructors

Link copied to clipboard
constructor(context: Context, configs: WhitelabelPayConfigurations)

Properties

Link copied to clipboard
open override val availableOfflineTokensCount: Int

The number of tokens available in the local storage.

Link copied to clipboard
open override val state: StateFlow<State>

Property that reflects the current state of the SDK.

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

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

Functions

Link copied to clipboard
open suspend override 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
open suspend override 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
open override fun deviceState(): State

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

Link copied to clipboard
open override fun getEnrolmentToken(): Token

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

Link copied to clipboard
open suspend override 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
open suspend override fun getPayments(page: Int, sortQuery: String?, status: TransactionStatus?): PaymentsOverview

Function to retrieve the payments history overview

Link copied to clipboard
open suspend override 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
open suspend override 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
open suspend override fun reactivatePaymentMean(paymentMeanId: UUID, onReactivationSuccess: () -> Unit)

Calling this method will reactivate a deactivated payment mean.

Link copied to clipboard
open override fun reset()

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

Link copied to clipboard
open override fun setNotificationId(notificationId: String)
Link copied to clipboard
open suspend override 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
open suspend override fun sync(): State

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