braintree/braintree_java

Card masking issues and card mask in PaymentMethodNonceDetails.java

Opened this issue · 0 comments

General information

  • SDK/Library version: 3.34.0
  • Environment: All
  • Language, language version, and OS: All

Issue description

  1. We have a need where we have a generated a nonce, and from the Java SDK, we would like to know the correct masking for the credit card number behind that nonce.

The class PaymentMethodNonceDetails.java ( https://github.com/braintree/braintree_java/blob/master/src/main/java/com/braintreegateway/PaymentMethodNonceDetails.java ) has the basic information, like bin and lastFour and cardType ... but it would it would be better if there was an actual field / property called maskedCardNumber in order to handle / cater for :

  • Visa which can have 16 to 19 digits ( The number of digits is not available in this class. braintree-web allows up to 19-digits for Visa ).
  • AMEX which is only 15 digits.
  • etc ...
  1. Speaking of card masking, the CreditCard.getMaskedNumber() at
    ( https://github.com/braintree/braintree_java/blob/master/src/main/java/com/braintreegateway/CreditCard.java#L357 )

image

  • Incorrectly returns 16-digit for AMEX when AMEX is only 15-digits
  • Does not correctly cater for Visa card numbers that are more than 16-digits ( braintree-web allows up to 19-digits for Visa )