Search code examples
javapaypal-sandboxbraintreebraintree-sandbox

Brain tree paypal integration failure


currently am working with payment gateway using brain tree. When i hit paypal fake nonce "fake-paypal-one-time-nonce" like the above on get an error message Processor Network Unavailable - Try Again but braintree nonce are working. I integrate my paypal with brain tree i use the following java code to hit

thanks.

    TransactionRequest request = new TransactionRequest();
    CustomerRequest customerRequest = request.customer();
    customerRequest.email(nonceDetails.getString("email"))
            .firstName(nonceDetails.getString("name"))
            .phone(nonceDetails.getString("mobileNumber"));

    request.amount(new BigDecimal(nonceDetails.getFloat("amount")))
            .paymentMethodNonce(nonceDetails.getString("nonce"))//<-- Here I put my nonce 
            .options()
            .submitForSettlement(true)
            .paypal()
            .done();


    try {
        Result<Transaction> result = bt.transaction().sale(request);
        if (result.isSuccess()) {

            Transaction transaction = result.getTarget();
            future.complete(transaction);
        } else if (result.getTransaction() != null) {
            Transaction transaction = result.getTransaction();
            logger.error("Error in BrainTreeGateWay::paymentConfirmationWithNonce - " + transaction.toString());
            future.fail(result.getErrors().toString());
        } else {
            for (ValidationError error : result.getErrors().getAllDeepValidationErrors()) {
                logger.error("Error in BrainTreeGateWay::paymentConfirmationWithNonce - " + error.getMessage());
            }
            future.fail(result.getErrors().toString());
        }

Solution

  • Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

    If you are using v3 of our JavaScript SDK and have your PayPal sandbox account enabled within your Braintree sandbox then you will need to receive a nonce directly from Braintree rather than using a test nonce value.

    Since the linked PayPal testing flow is intended to test the full functionality of your PayPal integration the PayPal test nonce values will no longer be compatible in your sandbox.

    I would recommend emailing in to Braintree Support so we can take a look at your sandbox setup and see if this is the case, or if something else is causing you to receive the 3000 failure response.