SessionComponentCallback

Implement this callback to interact with a PaymentComponent initialized with a session.

Functions

Link copied to clipboard
abstract fun onAction(action: Action)

Indicates that an action needs to be handled to continue the payment flow. You can call component.handleAction to handle this action.

Link copied to clipboard
open fun onAdditionalDetails(actionComponentData: ActionComponentData): Boolean

Override this method if you want to take over the sessions flow and make a network call to the /payments/details endpoint of the Checkout API through your server.

Link copied to clipboard
abstract fun onError(componentError: ComponentError)

The component has encountered an error. Use ComponentError.exception to get the internal exception.

Link copied to clipboard
abstract fun onFinished(result: SessionPaymentResult)

Indicates that the payment flow has finished.

Link copied to clipboard
open fun onLoading(isLoading: Boolean)

Indicates that an API call is being executed by the component. Could be used to show a loading indicator in your UI.

Link copied to clipboard
open fun onPermissionRequest(requiredPermission: String, permissionCallback: PermissionHandlerCallback)

Should be overridden to support runtime permissions for components. Runtime permission should be requested and communicated back through the callback. If not overridden, PermissionHandlerCallback.onPermissionRequestNotHandled will be invoked, which will show an error message.

Link copied to clipboard
open fun onStateChanged(state: T)

You can implement this optional method to receive an update any time the state of the component changes.

Link copied to clipboard
open fun onSubmit(state: T): Boolean

Override this method if you want to take over the sessions flow and make a network call to the /payments endpoint of the Checkout API through your server.