Clearent JavaScript SDK

Examples

Overview Security Considerations Configuration Styling / Branding Digital Wallets IDTech VP8300 Examples

Basic Example

This code . . .


<script type="text/javascript">
    ClearentSDK.init({
        "baseUrl": "https://gateway-sb.clearent.net",
        "pk": "YOUR PUBLIC KEY GOES HERE"
    });
</script>
            

Produces this form:

Customize Placeholders

This code . . .


<script type="text/javascript">
    ClearentSDK.init({
        "baseUrl": "https://gateway-sb.clearent.net",
        "pk": "YOUR PUBLIC KEY GOES HERE",
        "cardPlaceholder": "Enter credit/debit card number",
        "expDatePlaceholder": "Enter card expiration date",
        "cvcPlaceholder": "Card Security Code"
    });
</script>
            

Produces this form:

Show Fields Unmasked

This code . . .


<script type="text/javascript">
    ClearentSDK.init({
        "baseUrl": "https://gateway-sb.clearent.net",
        "pk": "YOUR PUBLIC KEY GOES HERE",
        "cardMasked": false,
        "expDateMasked": false,
        "cvcMasked": false
    });
</script>
            

Produces a form where the card data is not masked when the field loses focus. This may be helpful in certain POS implementations but is not recommended for a cardholder-facing solution.