I am using Braintree for payment gateway.
I have a requirement where I need to store only last 4 digits of credit card, expiry date (As per PCI Complaince).
I have implemented front-end code in javascript and on sending data to server, credit card information is encrypted.
Is there anyway I can get last four digits, expiry date and card type at backend or can I decrypt it?
<form name="paymentForm" action="/createtransaction" method="post" id="braintree-payment-form">
<p>
<label style="color:white">Card Number</label>
<input type="text" size="20" ng-model="userDetails.number" autocomplete="off" data-encrypted-name="number" />
</p>
<p>
<label style="color:white">CVV</label>
<input type="text" size="4" ng-model="userDetails.cvv" autocomplete="off" data-encrypted-name="cvv" />
</p>
<p>
<label style="color:white">Expiration (MM/YYYY)</label>
<input type="text" size="2" ng-model="userDetails.month" data-encrypted-name="month" /> / <input type="text" size="4" ng-model="userDetails.year" data-encrypted-name="year" />
</p>
<input type="submit" id="submit" />