Encryption of Card Data Information

Card data information is sensitive data and shouldn't expose to any unauthorized party. We would like to ensure that sensitive data such as PAN, expiry date & CVV is securely integrated in between 2c2p and merchant end. Merchant could provide the best payment experience to the customer without requiring to go through complex and demanding requirement of PCIDSS and other compliances. We have provided Java Script SDK and allowed merchant to encrypted the data. Below show how it work.

 

Import 2c2p Java Script SDK


<script type="text/javascript" src="https://demo2.2c2p.com/2C2PFrontEnd/SecurePayment/api/my2c2p.1.6.9.min.js"></script>

🚧

Secure Pay JS library

Refer latest library for Demo & Live Environment

 

Prepare Card Data Fields


Follow the below html field to prepare the data. Add 'data-encrypt' fields into form to capture card information securely.

<form id="2c2p-payment-form" action="[Merchant Backend]" method="POST"> 
    <input type="text" data-encrypt="cardnumber" maxlength="16" placeholder="Credit Card Number"><br/>
    <input type="text" data-encrypt="month" maxlength="2" placeholder="MM"><br/>
    <input type="text" data-encrypt="year" maxlength="4" placeholder="YYYY"><br/>
    <input type="password" data-encrypt="cvv" maxlength="4" autocomplete="off" placeholder="CVV2/CVC2"><br/>
    <input type="submit" value="Submit">
</form>

Attribute

Description

data-encrypt="cardnumber"

To capture the credit card number encrypted

data-encrypt="month"

To capture the credit card expire month encrypted

data-encrypt="year"

To capture the credit card expire year encrypted

data-encrypt="cvv"

To capture the credit card security code encrypted

 

Submit Form


Submit form via 2c2p SDK. Validation will be perform from 2c2p end, if successfully validated, form will be submitted to merchant backend, else error return be return refer below

<script type="text/javascript">
    My2c2p.onSubmitForm("2c2p-payment-form", function(errCode,errDesc){
        if(errCode!=0){
            alert(errDesc+" ("+errCode+")");
        }
    });
</script>

Error Code

Description

0

Success

1

Card number is required

2

Card number is invalid

3

Expiry month is required

4

Expiry month must be two numbers

5

Expiry year is required

6

Expiry year must be four numbers

7

Card already expired(year)

8

Card already expired(month)

9

Expiry month is invalid

10

CVV2/CVC2 is invalid