Use Secure Fields to collect the CVV for cards previously stored.
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.
The first step is to store the card data for future use. Use the checkout
session as described in our quick-start to store the card
details as a new payment method in our vault.This can be done either at the time of creating a transaction by
setting the store 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 we can use in the next step.
At checkout, Secure Fields can be used to collect the CVV for a previously stored card.When initializing Secure Fields, make sure to pass the id of the previously stored card.
When using the paymentMethodId with Secure Fields, only the
security code can be captured. Attempting to add any of the other
fields (number, expiration date) will result in an error.
When Secure Fields is submitted, it will collect the security code for
the stored payment method. You can then create a transaction with the
checkout session much like a regular Secure Fields transaction.
Copy
Ask AI
var transaction = await _client.Transactions.CreateAsync( transactionCreate: new TransactionCreate() { Amount = 1299, Currency = "MXN", Country = "MX", PaymentMethod = TransactionCreatePaymentMethod.CreateCheckoutSessionWithUrlPaymentMethodCreate( new CheckoutSessionWithUrlPaymentMethodCreate() { Id = checkoutSession.Id, } ), });
The returned transaction includes details about the payment method used, and the
status of the transaction.