Secure CVV Form Reference

This is the API reference for the Secure CVV Form. The Secure Code Form is a form that you can include in your site to securely collect a customer’s CVV code. The Secure Code Form generates the CVV’s input field and handles the logic of grabbing the CVV submitted by the user. For more information and examples, see Collecting the CVV Code.

POSC()

The class on which you call the library's static methods.

(static) createToken(callback)

Returns a token representation of the CVV code submitted through the form.
Parameters:
Name Type Description
callback function A callback function. The function must take a single parameter through which the token is returned.
Example
POSC.createToken(function(result) {
// Grab the encrypted CVV code here
});

(static) initCvvEncryptor(tag, width, height)

Initializes and displays the form's CVV field.
Parameters:
Name Type Description
tag string The ID of the DOM element in which the form should be displayed.
width string (optional) The width of the form. Can be any valid CSS unit.
height string (optional) The height of the form. Can be any valid CSS unit.

(static) setDirectionRtl()

Sets the field's display direction from right to left.

(static) setEnvironment(env)

Sets the PaymentsOS environment (test or live) against which the CVV form will be initialized.
Parameters:
Name Type Description
env string The PaymentsOS environment. Either test or live.

(static) setPaymentToken(deploymentToken)

Sets the token that belongs to the payment method that the customer chose to use.
Parameters:
Name Type Description
deploymentToken string The token that belongs to the payment method that the customer chose to use.

(static) setPublicKey(key)

Authenticates the library using your public key.
Parameters:
Name Type Description
key string The public key belonging to your business unit in either your test or live environment.

(static) setSecurityNumberPlaceholder(placeholder)

Sets the CVV code's input field placeholder text. Default placeholder text is "CVV".
Parameters:
Name Type Description
placeholder string The security code's input field placeholder text.

(static) setStyle(style)

Applies CSS styles to the form.
Parameters:
Name Type Description
style object A JSON object containing the CSS styles you want to apply. See Customizing the Form's Look and Feel.
Last modified January 6, 2022