Magento2: Braintree not working

Created on 28 Dec 2016  路  8Comments  路  Source: magento/magento2

Brain tree not working, When I try a payment on sandbox or production it says it cannot complete this.

Preconditions

Magento 2.1.3

PHP 7.0.14 (cli) (built: Dec 7 2016 10:15:15) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
openssl
pcntl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

Steps to reproduce

  1. Sign up for braintree
  2. Plug info into back end of site.
  3. Try to submit a CC

Expected result

  1. Should check out.

Actual result

  1. Throws Error: An error occurred on the server. Please try to place the order again.
    2016-12-29 03:48:11] main.DEBUG: array (
    'request' =>
    array (
    'customer' =>
    array (
    'firstName' => 'xxxxx',
    'lastName' => 'xxxx',
    'company' => 'xxxx',
    'phone' => 'xxxx',
    'email' => '[email protected]',
    ),
    'amount' => '1.80',
    'paymentMethodNonce' => 'xxxxxxx',
    'orderId' => '000000029',
    'merchantAccountId' => 'xxxxxx',
    'channel' => 'Magento2_Cart_Community_BT',
    'billing' =>
    array (
    'firstName' => 'xxxxxx',
    'lastName' => 'xxxxxx',
    'company' => 'xxxxx',
    'streetAddress' => 'xxxx xxxx xxxx',
    'extendedAddress' => 'xxxxx xxxxx',
    'locality' => 'xxxx xxxx',
    'region' => 'xxxxx',
    'postalCode' => 'xxxx',
    'countryCodeAlpha2' => 'xxxx',
    ),
    'shipping' =>
    array (
    'firstName' => 'xxxxxx',
    'lastName' => 'xxxxxx',
    'company' => 'xxxxx',
    'streetAddress' => 'xxxxxx',
    'extendedAddress' => 'xxxxx x',
    'locality' => 'xxxxx x',
    'region' => 'xxxxx',
    'postalCode' => 'xxxx',
    'countryCodeAlpha2' => 'xxxx',
    ),
    'options' =>
    array (
    'storeInVaultOnSuccess' => true,
    ),
    'descriptor' =>
    array (
    'phone' => 'xxxxxxxx',
    'url' => 'xxxxxx',
    ),
    ),
    'client' => 'Magento\Braintree\Gateway\Http\Client\TransactionSale',
    'response' =>
    array (
    ),
    ) {"is_exception":false} []
Payment needs update bug report

Most helpful comment

We have a live Magento 2.1.3 website getting many orders a day successfully... several customers have gotten the "An error occurred on the server. Please try to place the order again." while trying to checkout. Which took me a while to recreate. When we look in the failed transactions in our Braintree account we see those customers got Soft Declines... so I feel this issue is just of poor error wording for customers that need to make sure their Billing addresses are correct or have a talk with their bank to let the charge through.

In our Magento 1.9.x website we got Failed Transaction notifications and followed up better with customers when we saw payment failure issues. We wish this feature was in M2 as well.

All 8 comments

Hi @zdjm! Seems like checkout flow problem. Please answer few questions:

  1. Describe unsuccessful checkout flow (any messages appears after place order?)
  2. Is any logs from Braintree gateway presented in log files? You need to try place order with Debug Mode = Yes option set.
  3. Have you tried to place order with other CC payment methods?
  4. Is cart or mini shopping cart is empty after unsuccessful place order?

regards,

We have a live Magento 2.1.3 website getting many orders a day successfully... several customers have gotten the "An error occurred on the server. Please try to place the order again." while trying to checkout. Which took me a while to recreate. When we look in the failed transactions in our Braintree account we see those customers got Soft Declines... so I feel this issue is just of poor error wording for customers that need to make sure their Billing addresses are correct or have a talk with their bank to let the charge through.

In our Magento 1.9.x website we got Failed Transaction notifications and followed up better with customers when we saw payment failure issues. We wish this feature was in M2 as well.

Our experience is similar to EmilyPepperman's. Whenever there is a decline of any sort from Braintree, the message is not passed back to the user. Rather, the end user simply sees "An error occurred on the server. Please try to place the order again." This makes no sense, as it wasn't a server error... it was a processor decline of some sort.

We have seen this issue for "Invalid Credit Card Number", "Voice Authorization Required", and others. Pretty much any time Braintree doesn't approve the transaction, it will look like a server error to the end user. This needs to be fixed. I would do it myself, but I am having trouble figuring out exactly where in the code to override the response.

Steps to Reproduce

Check out with Braintree payment option
Give any payment info that will cause a decline

Expected Result

Either:

  • The response message directly from Braintree. (While this may not be the best error message 100% of the time, it certainly is better than the current error shown to the user.) This should come from the Braintree response object (response->params->message)
  • 'The payment method was declined. Please check your payment details.' (If a generic message is preferable)

@EmilyPepperman @sbrendtro Magento provides only high-level errors by design it allows to make an application more secure.

But anyway, you can implement your own WEB API entry points for https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Api/PaymentInformationManagementInterface.php#L23 and https://github.com/magento/magento2/blob/develop/app/code/Magento/Checkout/Api/GuestPaymentInformationManagementInterface.php#L24 at your own risk.

We are closing this issue because it hasn鈥檛 been updated in more than two weeks by the reporter.

If you still can reproduce the issue, please, be free to reopen it.

@joni-jones, that may be, but this high-level error is very confusing to customers. At the very least it should be reworded to be something more like "There was an issue with your payment method. Please check your payment details." The core of the issue is that the customer gets a message about there being a problem on the server, when in fact it is their own card details. That's just bad design.

Also, I don't understand why it is being closed when we were waiting on someone from the dev team to update it. This is still an issue.

@sbrendtro, this ticket is closed because the reporter didn't provide additional details during 2 weeks. This issue doesn't relate to generic error messages for failed place order flow.

Was this page helpful?
0 / 5 - 0 ratings