# startPaymentActivity

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

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

The promptParameters allow the developer to customize the payment prompt UI and other aspects of the payment flow. See PromptParameters for more information.

A callback is used to notify the application of the completion (whether success or failure). If the payment was successful, meaning that funds were actually paid, the success value is a Payment describing the payment. In case of failure, error description would contain a PaymentErrorCode.

Only one payment may be in progress at a given moment. Making a second call to startPaymentActivity before the first call has triggered the payment callbacks will fail immediately, calling the payment callbacks with PaymentErrorCode.USAGE_ERROR. The first call will continue, however.

#### Return

PaymentHandle can be used for interaction with the just-started payment and for canceling it.

#### Parameters

paymentParameters

a description of the payment to be taken

promptParameters

a description of how to prompt the user for the payment (e.g. whether the application will draw its own prompt or wants the SDK's default, and what additional methods other than cardreaders should be offered)

callback

a callback to handle results of the payment.