Secure Fields Form Reference

This is the API reference for the Secure Fields Form. The Secure Fields Form is an HTML form that you can include in your site to collect a user’s card information. When using the Secure Fields Form, PaymentsOS generates the card details input fields and handles the logic of grabbing the card information submitted by the user.

For more information and examples, see Using the Secure Fields Form.

POS()

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

(static) createToken(additionalData, callback)

Returns a token representation of the card data submitted through the secure fields form.
Parameters:

Name Type Description
additionalData object (optional) A JSON object containing key - value pairs of additional data. You can use this data to complement the card data provided by the customer.
callback function A callback function. The function must take a single parameter through which the token is returned.
Example
POS.createToken(additionalData, function(result) {
    // Grab the token here
 });

(static) disableCardFormatter()

Disable card formatting. This options disables auto-formatting of the credit card number into groups of digits.

(static) disableCardImage()

Disables the card image field. This option prevents the card’s image from appearing.

(static) disableLuhnValidation()

Disables the Luhn check for validating a card's number.

(static) disableSecurityNumber()

Disables the security number (cvv, cvc etc.) field. When you set this option, the security number input field will not appear on the form.

(static) initSecureFields(tag, width, height)

Initializes and displays the form's fields.
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) setCardNumberPlaceholder(placeholder)

Sets the card number's input field placeholder text. Default placeholder text is "card number".
Parameters:
Name Type Description
placeholder string The card number's input field placeholder text.

(static) setDirectionRtl()

Sets the fields' display direction from right to left.

(static) setEnvironment(env)

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

(static) setExpirationDatePlaceholder(placeholder)

Sets the expiration date's input field placeholder text. Default placeholder text is "mm / yy".
Parameters:
Name Type Description
placeholder string The expiration date's input field placeholder text.

(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 security 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.

results matching ""

    No results matching ""