We recommend using payment_method_nonce to avoid any PCI concerns with raw credit card data being present on your server.

The 12-19 digit value on a credit card consisting of a bank identification number (BIN) and primary account number (PAN).

:options

Optional values that can be passed with a request.

:fail_on_duplicate_payment_methodbool

If this option is passed and the payment method has already been added to the Vault, the request will fail. This option will not work with PayPal payment methods.

:make_defaultbool

This option makes the specified payment method the default for the customer.

:verification_amountString

Specify a non-negative amount that you want to use to verify a card. If you do not pass this option, the gateway will automatically use a verification amount of $0 or $1, depending on the processor and/or card type.

If the payment method is a credit card, this option prompts the gateway to verify the card's number and expiration date. It also verifies the AVS and CVV information if you've enabled AVS and CVV rules. If you want to verify all cards before they are stored in your Vault, you can turn on card verification for your entire account in the Control Panel.

In some cases, cardholders may see a temporary authorization on their account after their card has been verified. The authorization will fall off the cardholder's account within a few days and will never settle.

One-time-use reference to payment information provided by your customer, such as a credit card or PayPal account.

The ability to transact on credit card information will not be verified automatically on create – you must explicitly perform card verification.

:tokenString

An alphanumeric value that references a specific payment method stored in your Vault. Must be less than or equal to 36 characters. If using a custom integration, you can specify what you want the token to be. If not specified, the gateway will generate one that can be accessed on the result. If using our Drop-in UI with a customer ID to vault payment methods, you can't specify your own token. Length and format of gateway-generated tokens and IDs may change at any time.

Examples

Specify a token

If you are using a custom integration and want to specify what you would like the token to be, pass it with the other parameters, as in the example below. If you do not specify a payment method token, the gateway will generate a random one. Note that if you are using our Drop-in UI, you can't specify your own token.

New default payment method

If a customer has multiple payment methods, the first payment method created will be the
customer's default. The default payment method is used when
creating transactions with customer_id. To set a new payment method as the default, use the make_default option.

New payment method with billing address

To specify a billing address when creating a new payment method, use the billing_address option
(ignored if the payment method is a PayPal account). Note that the specified billing address will override any address specified during nonce creation.

Preventing duplicate payment methods

If a payment method exists in your Vault and you do not want to create a new payment method, you can reject duplicates by using the fail_on_duplicate_payment_method option. Note: This option will not work with PayPal payment methods.

If you are using our Advanced Fraud Tools, we strongly recommend passing device_data each time you verify a card.

Payment method nonces vs. raw card data

While it is possible to pass both raw card data and a payment method nonce in the same call, we recommend passing only a payment method nonce.

Passing both will result in a payment method that has a mix of their attributes, with precedence given to the fields individually, then to the attributes of the payment method nonce. For example, if you pass both a card number and a payment method nonce, the payment method will have the number you passed explicitly, but the rest of the attributes will be obtained through the nonce.