CartThrob 10 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

Save Vault Field Value

save_vault_field_value returns an encrypted y value for a checkout save-card input. This is an immediate-execution single tag with no tag-specific parameters.

See also:

Parameters

This tag has no tag-specific parameters.

Behavior and Constraints

With default form-choice discovery enabled, this tag inside checkout_form opens the signed save-card choice, just as save_vault_checkbox does. Use the returned value in an input named VLT or force_vault. A fixed force_vault= on the enclosing tag takes precedence. Other CartThrob forms do not open this save-card choice.

A plain hand-written input without either helper needs options:force_vault="yes|no" on checkout_form; this also works when discovery is disabled. Save-card values accept every bool_string() spelling, ignoring case: y, n, yes, no, 1, 0, on, off, true, false, t, f. An open choice rejects other values with “Choose a valid option.” Without an open choice, posted values do nothing.

Use force_vault="yes" on checkout_form for a fixed save-card request. Use the checkbox when the customer should choose.

Examples

Use inside the checkout form body:

{exp:cartthrob:checkout_form return="store/order_complete"}
    {gateway_fields}
    <label>
        <input type="checkbox" name="VLT" value="{exp:cartthrob:save_vault_field_value}">
        Save my card
    </label>
    <button type="submit">Pay</button>
{/exp:cartthrob:checkout_form}

For a checkbox generated completely by CartThrob, use save_vault_checkbox.