# PaymentManager

interface PaymentManager

Processes payments for Mobile Payments SDK.

`PaymentManager` is a singleton instance, retrieved from MobilePaymentsSdk.paymentManager like the other managers. Use it by starting a payment with startPaymentActivity.

When calling startPaymentActivity, the developer has an option to either use the default payment prompt screen or provide a custom one (see PromptMode). This screen is where the customer is asked to swipe, insert, or tap a card.

If the custom screen is used, the Mobile Payments SDK will take control over UI, once the customer interacts with the card reader.

During the payment flow, Mobile Payments SDK will show screens (for example, to collect PIN numbers, and to confirm the completed transaction to the user), which will be dismissed by the time the payment completion callback is called.

## Functions

completePayment
Link copied to clipboard
abstract fun completePayment(paymentId: String, callback: Callback<PaymentResult>): PaymentHandle

Completes a previously-authorized payment.

getAvailableCardEntryMethods
Link copied to clipboard
abstract fun getAvailableCardEntryMethods(): Set<CardEntryMethod>

Retrieves the possible card entry methods to take a payment. This is the union of all the several card readers' supported card entry methods.

getOfflinePaymentQueue
Link copied to clipboard
abstract fun getOfflinePaymentQueue(): OfflinePaymentQueue

Returns an OfflinePaymentQueue interface, used to interact with offline payments.

setAvailableCardEntryMethodChangedCallback
Link copied to clipboard
abstract fun setAvailableCardEntryMethodChangedCallback(callback: Callback<Set<CardEntryMethod>>): CallbackReference

Registers a callback to notify the application when the set of available card entry methods changes. For example, as a magstripe reader is inserted or removed, this callback will be called to reflect the availability of the SWIPED card entry method.

startPaymentActivity
Link copied to clipboard
abstract fun startPaymentActivity(paymentParameters: PaymentParameters, promptParameters: PromptParameters, callback: Callback<PaymentResult>): PaymentHandle

Begins a payment, using the provided paymentParameters to set the payment information.