Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card masking issues and card mask in PaymentMethodNonceDetails.java #131

Open
jmsjr opened this issue Sep 6, 2024 · 0 comments
Open

Card masking issues and card mask in PaymentMethodNonceDetails.java #131

jmsjr opened this issue Sep 6, 2024 · 0 comments

Comments

@jmsjr
Copy link

jmsjr commented Sep 6, 2024

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 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant