> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Inscription React Native

> Enregistrez les moyens de paiement des clients pour un usage ultérieur avec le SDK React Native.

> [!NOTE]
>
> **This page documents a legacy SDK.** Starting a new integration? Use the [Yuno SDK](https://docs.y.uno/docs/yuno-sdk/get-started.md). Already on a legacy SDK? Follow the [migration guide](https://docs.y.uno/docs/yuno-sdk/migration/overview.md).
>
> The new **Yuno SDK** (Web v2.x, iOS v3.x, Android v3.x, React Native v2.x) replaces the Full, Lite, Seamless, Render, Headless, and Secure Fields SDKs with one API across every platform. Legacy SDKs remain supported side by side during the transition and are scheduled for deprecation in **2027**. Contact your Account Manager for migration planning.

> [!WARNING]
>
> **Orientation: Choosing Your Integration Flow**, before you begin, please review the [Official Integration Flow](https://docs.y.uno/docs/sdks/overview/understanding-flows.md).
>
> * **Standard Flow ([Full Checkout](https://docs.y.uno/docs/sdks/full-checkout/web-payments))**: Recommended for most merchants. Yuno handles the UI, security, and automatic updates for payment methods.
> * **Custom Flow (This SDK)**: Use this only if you require full control over the UX. **Note**: You will be responsible for manually handling payment statuses, 3DS transitions, and fraud routing data collection.

Yuno vous permet d'enregistrer des moyens de paiement (inscription), soit pendant un flux de paiement, soit comme étape autonome.

## Enregistrer pendant le paiement

Pour enregistrer une carte pendant un flux de paiement classique, incluez le flag `vault_on_success` lors de la création du paiement sur votre backend.

```typescript theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// When creating payment on backend, include vault_on_success flag
async function createPayment(token: string, checkoutSession: string) {
  await fetch('/api/payment/create', {
    method: 'POST',
    body: JSON.stringify({
      one_time_token: token,
      checkout_session: checkoutSession,
      vault_on_success: true, // Save after successful payment
    }),
  });
}
```

## Inscription séparée

Utilisez le flux d'inscription pour enregistrer un moyen de paiement sans traiter de paiement.

```typescript theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// 1. Create customer session on backend
const customerSession = await createCustomerSession('cus_123');

// 2. Set up listener
const enrollmentSubscription = YunoSdk.onEnrollmentStatus((state) => {
  if (state.status === 'SUCCEEDED') {
    console.log('Card saved successfully');
  }
});

// 3. Start enrollment flow
await YunoSdk.enrollmentPayment({
  customerSession: customerSession.id,
  countryCode: 'US',
  showPaymentStatus: true,
});

// 4. Clean up
enrollmentSubscription.remove();
```

## Listeners

Utilisez `onEnrollmentStatus` pour suivre la progression du flux d'inscription.

| Statut | Description |
| - | - |
| `SUCCEEDED` | Le moyen de paiement a été enregistré avec succès. |
| `FAILED` | L'inscription a échoué. |
| `CANCELED` | L'utilisateur a fermé le flux d'inscription. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.