Introduction
The user enters their card into a Crossmint-hosted UI, and your app receives apaymentMethodId for subsequent API calls. Raw card data never reaches your servers.
Saving the card does not grant spending permission. You register the saved card to discover its supported rails, then create and verify a separate order intent before minting credentials.
Prerequisites
- Crossmint API key — a client-side key with
payment-methods.createandpayment-methods.readscopes. In staging, all scopes are included by default. - User JWT — authenticate the user with Crossmint Auth or a configured external provider.
Steps
1
Install the SDK
2
Wrap your app with the Crossmint provider
Set up
CrossmintProvider at the root of your app. This makes the Crossmint SDK available to all child components.3
Add the card collection component
Place this component on a page where the user manages their payment methods, or in an ephemeral UI dedicated to saving cards.The
CrossmintPaymentMethodManagement component handles all PCI compliance concerns. Card data is collected directly by Crossmint and never passes through your servers — this is why the UI must be rendered inside your app rather than called from your backend.In staging, use the test card number 4242 4242 4242 4242 with any future expiration date and any three-digit CVC. For additional scenarios, see Register a Card.
4
Store the payment method ID
When the user saves a card, the
onPaymentMethodSelected callback returns a paymentMethodId. Persist this ID in your backend associated with the user, apply strict access controls, and avoid exposing it in client-side storage or logs.The ID cannot reveal the original card number, but it can be used to register the card and create order intents.
