# Let customers pay in their local currency

Add Adaptive Pricing and the Currency Selector Element to mobile checkout.

Use [Adaptive Pricing](https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing.md) with the [Currency Selector Element](https://docs.stripe.com/payments/mobile/checkout-sessions/build-a-checkout-page.md#currency-selector) to let eligible customers choose between your integration currency and a localized currency. Stripe localizes prices, provides the required exchange rate disclosure, updates available payment methods, and handles currency conversion.

### Want access to Mobile Checkout Elements?

Mobile Checkout Elements is in private preview. Share your email address to request access.

```bash
curl https://docs.stripe.com/preview/register \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Referer: https://docs.stripe.com/payments/mobile/checkout-sessions/adaptive-pricing" \
  -d '{"email": "EMAIL", "preview": "elements_beta_preview"}'
```
![Checkout with a Currency Selector Element showing 70.23 in GBP and 90.00 in USD, with USD selected and the exchange rate disclosed below.](https://b.stripecdn.com/docs-statics-srv/assets/adaptive-pricing-currency-selector.19ec542d986ec866e58a447febca94fa.png)

The preview supports one-time payments only. Adaptive Pricing requires Checkout Sessions and isn’t supported with the Payment Intents API.

# React Native


## Before you begin

Before you add Adaptive Pricing, complete these tasks:

- [Build a mobile checkout with Checkout Sessions](https://docs.stripe.com/payments/mobile/checkout-sessions/build-a-checkout-page.md).
- Review the Adaptive Pricing [supported regions, currencies, and restrictions](https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing.md?payment-ui=embedded-components#restrictions).

When Adaptive Pricing is active, the client-side Session includes localized line items and totals. When a customer selects a currency in the Currency Selector Element, it updates the shared Session, available payment methods, and other Session-backed Elements. The server-side [Checkout Session](https://docs.stripe.com/api/checkout/sessions/object.md) remains denominated in your integration currency and exposes the customer’s presentment context separately.

## Enable Adaptive Pricing on the Checkout Session [Server-side]

Enable Adaptive Pricing in your [Payments settings](https://dashboard.stripe.com/settings/adaptive-pricing) in the Dashboard, or set [adaptive_pricing.enabled](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-adaptive_pricing-enabled) to `true` when you create the Checkout Session on your server. Use an integration currency that’s one of your [settlement currencies](https://docs.stripe.com/payouts/multi-currency-settlement.md).

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d ui_mode=mobile_elements \
  -d "adaptive_pricing[enabled]=true" \
  -d "items[0][type]=one_time_price" \
  -d "items[0][one_time_price][items][0][price]={{PRICE_ID}}" \
  -d "items[0][one_time_price][items][0][quantity]=1"
```

## Configure Adaptive Pricing [Client-side]

When you configure the Currency Selector Element, you must also [render it](https://docs.stripe.com/payments/mobile/checkout-sessions/adaptive-pricing.md#add-currency-selector) and [display localized prices](https://docs.stripe.com/payments/mobile/checkout-sessions/adaptive-pricing.md#render-localized-prices) throughout your checkout.

Pass a `currencySelectorElement` configuration in the options you return from `getConfiguration` to enable Adaptive Pricing on the client.

Pass the configuration to the `useCheckoutElements` hook before you display your checkout content.

```tsx
import { useCallback } from 'react';
import { ActivityIndicator, Text } from 'react-native';
import { useCheckoutElements } from '@stripe/stripe-react-native/src/hooks/useCheckoutElements';
import type { CheckoutElements } from '@stripe/stripe-react-native/src/types/CheckoutElements';
import { CheckoutContent } from './CheckoutContent';

export default function CheckoutScreen() {
  const getConfiguration = useCallback(
    async (): Promise<CheckoutElements.CreateOptions> => {
      // Create a Checkout Session on your server and return its client secret.
      const { clientSecret } = await fetchCheckoutSession();
      return {
        clientSecret,
        returnURL: 'your-app://stripe-redirect',
        paymentElement: {},
        currencySelectorElement: {
          appearance: {
            shapes: { cornerRadius: 12 },
            labelContent: 'amount',
          },
        },
      };
    },
    []
  );

  const checkout = useCheckoutElements({ getConfiguration });

  if (checkout.status === 'error') {
    return <Text>{checkout.error?.message}</Text>;
  }

  if (!checkout.session) {
    return <ActivityIndicator />;
  }

  return <CheckoutContent checkout={checkout} />;
}
```

> Configuring the Currency Selector Element doesn’t guarantee that Adaptive Pricing is available for the Checkout Session.

## Add the Currency Selector Element [Client-side]

Place the Currency Selector Element near your order total. It displays only when Adaptive Pricing is available, and updates the Checkout Session when the customer selects a currency.

Render a single `CheckoutCurrencySelectorElementView` in your checkout.

```tsx
import { View } from 'react-native';
import { CheckoutCurrencySelectorElementView } from '@stripe/stripe-react-native/src/components/CheckoutCurrencySelectorElementView';
import type { CheckoutElements } from '@stripe/stripe-react-native/src/types/CheckoutElements';

export function CheckoutContent({
  checkout,
}: {
  checkout: CheckoutElements.UseResult;
}) {
  return (
    <View>
      {checkout.currencySelectorElement && (
        <CheckoutCurrencySelectorElementView
          element={checkout.currencySelectorElement}
        />
      )}
    </View>
  );
}
```

The Currency Selector Element can grow or shrink when a customer expands or collapses the exchange rate details. `CheckoutCurrencySelectorElementView` resizes to fit its content, so you don’t need to handle height changes.

If `checkout.currencySelectorElement` is `null`, don’t reserve spacing for the Element.

## Render localized prices [Client-side]

Render every amount in your checkout from the latest `session` from `useCheckoutElements`, including line items, discounts, tax, shipping, and totals.

The `amount` values are localized strings that already reflect the selected currency and locale. `useCheckoutElements` re-renders your component when the Session changes, so your UI updates after a currency change.

```tsx
import { Text, View } from 'react-native';
import type { CheckoutElements } from '@stripe/stripe-react-native/src/types/CheckoutElements';

export function OrderSummary({ checkout }: { checkout: CheckoutElements.UseResult }) {
  const { session } = checkout;
  if (!session) return null;

  const { totals } = session;
  return (
    <View>
      <Text>Subtotal {totals.subtotal.amount}</Text>
      <Text>Tax {totals.taxExclusive.amount}</Text>
      <Text>Total {totals.total.amount}</Text>
    </View>
  );
}
```

## Testing

To test local currency presentment, pass a location-formatted customer email that includes a `+location_XX` suffix in the local part of the email. `XX` must be a valid [two-letter ISO country code](https://www.nationsonline.org/oneworld/country_code_list.htm).

For example, to test currency presentment for a customer in France, set [customer_email](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-customer_email) to `test+location_FR@example.com` when you create the Checkout Session. Your app displays the currency that a customer in France would see.

```curl
curl https://api.stripe.com/v1/checkout/sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d ui_mode=mobile_elements \
  --data-urlencode "customer_email=test+location_FR@example.com" \
  -d "adaptive_pricing[enabled]=true" \
  -d "items[0][type]=one_time_price" \
  -d "items[0][one_time_price][items][0][price]={{PRICE_ID}}" \
  -d "items[0][one_time_price][items][0][quantity]=1"
```

Stripe test cards work as usual.

