It is possible to use Secure Fields to collect card details on a profile page to store the card on a buyer’s account. Secure Fields can then be used to collect the security code at checkout, allowing a buyer to use a stored card together with a securely collected security code.Documentation Index
Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Store card for future use
The first step is to store the card data for future use. Use the checkout session as described in the quick-start to store the card details as a new payment method in the vault. This can be done either at the time of creating a transaction by setting thestore property to true,
or when creating a new payment method
directly from the checkout session.
The returned payment method includes details about the card that was used, as well
as the id of the payment method that can be used in the next step.
2. Collect the CVV
At checkout, Secure Fields can be used to collect the CVV for a previously stored card. When initializing Secure Fields, pass thepaymentMethod object with both the id and scheme of the previously stored card. This enables proper validation for the security code based on the card scheme (for example, 3 or 4 digits) and provides the appropriate security code label (CVV, CVC, CID) in the field data.
The
paymentMethodId prop is deprecated but still supported for backward compatibility. We recommend using the new paymentMethod prop to benefit from scheme-specific CVV validation.