# Managing Payment Methods

OnsideKit provides a built-in screen where users can view, add, and remove the **bank cards** saved to their Onside account.

## Present the manager

```swift
@MainActor static func presentPaymentMethodsManager(
    completion: (@MainActor (Result<Void, OnsidePaymentMethodsManagerError>) -> Void)? = nil
)
```

```swift
Onside.presentPaymentMethodsManager { result in
    switch result {
    case .success:
        // The manager was presented and dismissed normally.
        break
    case .failure(.loginDiscarded):
        // The user dismissed the login screen shown before the manager.
        break
    case .failure(.notSupportedInLocalTesting):
        // Not available in local-testing mode.
        break
    }
}
```

`completion` is optional (`= nil`), so you can also call `Onside.presentPaymentMethodsManager()` with no arguments.

## Behavior

* **Implicit login.** If the user is not authenticated, OnsideKit presents the login flow first. If the user dismisses it, the completion fails with `.loginDiscarded`. See [Authentication & User Account](/sdk/core-concepts/authentication.md).
* **Local testing.** When the SDK is initialized with a `.storekit` configuration, this screen is unavailable and the call fails with `.notSupportedInLocalTesting`. See [Local Testing](/sdk/advanced-and-tooling/local-testing.md).

## Errors

`OnsidePaymentMethodsManagerError`:

<table><thead><tr><th width="280">Case</th><th>Cause</th></tr></thead><tbody><tr><td><code>.loginDiscarded</code></td><td>The user dismissed the login flow shown before the manager.</td></tr><tr><td><code>.notSupportedInLocalTesting</code></td><td>The SDK is running in local-testing mode (a <code>.storekit</code> configuration was passed to <code>initialize</code>).</td></tr></tbody></table>

## Customizing presentation

The manager is presented in a window owned by the SDK. You can choose which `UIWindowScene` it uses and override its theme via [`OnsideDelegate`](/sdk/customization/delegate.md), using the `.paymentMethodsManager` screen case.

{% hint style="info" %}
Looking to configure **Apple Pay**? That's a separate setup — see [Apple Pay](/sdk/purchasing/apple-pay.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onside.io/sdk/purchasing/payment-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
