Skip to content

Configuring config.paymentOptionsToExclude Method

Rotimi Joshua edited this page Sep 10, 2023 · 1 revision

Flutterwave Logo

config.paymentOptionsToExclude = []

Overview

The config.paymentOptionsToExclude method allows you to customize the payment options that are displayed based on currency within your application. By using this method and providing an array of payment options to exclude, you can control which payment methods are available for specific currencies.

How It Works

To utilize config.paymentOptionsToExclude, you can follow these steps:

  1. Declare an array of payment options you wish to exclude for a specific currency.

    config.paymentOptionsToExclude = [.bankAccount, .bankTransfer]

In the above example, replace .bankAccount and .bankTransfer with the actual payment option constants you want to exclude.

Set this array as the value for config.paymentOptionsToExclude. This informs the SDK which payment methods should not be displayed when the specified currency is in use.

Now, when the SDK processes a transaction with the specified currency, it will automatically filter out the payment options you've excluded from being displayed.

Use Cases

This method can be useful in various scenarios. For example:

  • Currency-Specific Restrictions: If you do not want to display certain payment methods for specific currencies due to regulatory or business requirements.

  • User Preferences: You can let users customize their payment options based on their preferences, excluding methods they don't use or need.

  • Testing and Development: During testing and development phases, you can limit the payment methods shown to focus on specific scenarios.