Skip to content

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

Open
@jmsjr

Description

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 )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Card masking issues and card mask in PaymentMethodNonceDetails.java · Issue #131 · braintree/braintree_java