1

I am using braintree with java, While creating the customer profile, I am getting the error messages like this

try{

            CustomerRequest request = new CustomerRequest()
                    .firstName("Kim")
                    .lastName("Jones")
                    .company("Jones Co.")
                    .email("mark.jones@example.com")
                    .fax("419-555-1234")
                    .phone("614-555-1234")
                    .id("asdasda23423433")
                    .paymentMethodNonce("88878692-0157-40c3-b23b-51c113ebf160")

                    .website("http://example.com");
                Result<Customer> result = gateway.customer().create(request);
                System.out.println("\n\n\t isSuccess=="+result.getSubscription());

        ValidationErrors validationErrors=result.getErrors();


for (ValidationError validationError : validationErrors.getAllDeepValidationErrors()) {
            ValidationErrorCode validationErrorCode=validationError.getCode();
            System.out.println("\n\t code==>"+validationErrorCode+"\t msg- "+validationError.getMessage());
        }

The problem is this validationErrorCode is coming as constant For ex:

CUSTOMER_ID_IS_IN_USE

PAYMENT_METHOD_PAYMENT_METHOD_NONCE_UNKNOWN

I didn't find this error codes in document anywhere

How I can get the remaining error codes?

I have been stuck. Please help.

Kamini
  • 690
  • 2
  • 13
  • 36

1 Answers1

0

I believe what you are looking for is the list of Braintree Validation Errors.

jwoo
  • 169
  • 1
  • 4
  • yes but I got above constants (i.e CUSTOMER_ID_IS_IN_USE) as errors not its integer codes. I want to know whether there is any doc for such types of constants – Kamini May 16 '16 at 09:42
  • The constants are available in [the library source](https://github.com/braintree/braintree_java/blob/master/src/main/java/com/braintreegateway/ValidationErrorCode.java). – Raymond Berg May 16 '16 at 18:54