Skip to main content
The encrypted-card rail returns the user’s saved card, including the CVC encrypted when the card was saved. Crossmint keeps that CVC for a limited time. Once it expires, the rail stops minting until the user types the CVC again. CrossmintCvcRecollection from @crossmint/client-sdk-react-ui renders Crossmint’s hosted CVC field for that step: the digits never reach your application.

Prerequisites

  • Saved and registered card — follow Save a Card and Register a Card.
  • Order intent with an encrypted-card rail — follow Approve an Order Intent.
  • Crossmint API key — a client-side key with the order-intents.read, payment-methods.read, and payment-methods.update scopes. In staging, all scopes are included by default.
  • User JWT — the JWT for the user who owns the card.
  • React SDK — @crossmint/client-sdk-react-ui 4.7.0 or later (4.12.0 or later to submit from your own button), with CrossmintProvider configured as in the other card guides.

When to Render the Component

Two signals tell you that the CVC must be collected again. Handle both. A rail read as active can still answer 409 if the CVC expires before the mint. Read the order intent right before the user starts the mint flow, and treat the 409 as the same condition as the pending status.

Render the Hosted CVC Field

Render CrossmintCvcRecollection in your client application with the user’s JWT and the paymentMethodId of the order intent’s card. The component renders a single CVC input and a confirm button, and no explanation of its own, so tell the user why the code is requested again.
After onComplete fires, fetch the order intent again: the encrypted-card rail returns to status: "active" and you can mint as described in Get a Card Number. onError receives { reason, retriable, message }. When retriable is true, the form stays mounted and the user can submit again. When it is false, the component renders nothing afterwards, so unmount it and show your own message. To style the form, pass an appearance prop as described in Customize UI.

Submit From Your Own Button

Pass hideSubmitButton to remove the Confirm button, and call ref.current.submit() from your own button. Read the order intent again in onComplete, not from the result of submit(): onComplete also fires when an update completes after submit() stopped waiting. In the example, onCvcUpdated is your function that reads the order intent again. Render RecollectCvc with key={paymentMethodId}, so that a different card starts with a new form.
submit() never rejects. It resolves with one of these statuses: After a timeout, unavailable does not mean that the update failed. If the update completed, onComplete fires, and the next submit() resolves complete. refused is the same error that onError reports with retriable: false. onError also reports errors that occur before the first submit, so the example handles refused in onError. The message of every status is diagnostic: log it, and show the user your own text.

Test in Staging

A freshly saved card does not reach pending_cvc_recollection during a normal test run. In staging, expire the CVC on demand:
cURL
The call answers 204. The rail then reports pending_cvc_recollection and mints answer 409 until the user completes the form. The endpoint is staging-only.

Next Steps

Get a Card Number

Mint the encrypted card once the rail is active again

Cancel Card Access

Cancel an order intent or delete a saved card