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

Braintree - server error - sandbox #10875

Closed
McDev814 opened this issue Sep 13, 2017 · 10 comments
Closed

Braintree - server error - sandbox #10875

McDev814 opened this issue Sep 13, 2017 · 10 comments
Labels
Component: Payment Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@McDev814
Copy link

After setting up a braintree sandbox account and entering merchant id, private and public keys, I tried to run a test transaction within the dollar range suggested in the braintree dev docs. The attempted transaction resulted with 'An error occurred on the server. Please try to place the order again.'

I know this issue has been raised before, but none of the suggested repairs worked.

Preconditions

  1. Magento 2.1.8 (developer mode)
  2. Ubuntu 16.04
  3. Apache 2.4
  4. MySQL 5.7
  5. PHP 7

Steps to reproduce

  1. Create Braintree Sandbox Account
  2. Enter merchant id, private key, and public key into magento braintree configuration and save.
  3. Browse store as guest, add an item into cart (between .01 and 999)
  4. Hover mouse over mini-cart and click 'Go to checkout'
  5. Enter Shipping information, using the same information as billing for card to be used, choose free shipping (only option enabled) and click 'Next'
  6. Enter credit card information and click 'Place Order'

Expected result

  1. Order should be placed successfully and transaction posted to braintree sandbox account.

Actual result

  1. An error is displayed to user: 'An error has occurred on the server. Please try to place the order again.'
  2. In error.log:
[2017-09-13 15:22:22] main.CRITICAL: Braintree error response. [] []
[2017-09-13 15:22:22] main.CRITICAL: Wrong transaction status [] []
  1. In debug.log:
[2017-09-13 16:38:25] main.DEBUG: array (
  'request' =>
  array (
    'customer' =>
    array (
      'firstName' => 'Name',
      'lastName' => 'Removed',
      'company' => NULL,
      'phone' => '555-555-5555',
      'email' => 'user@mail.com',
    ),
    'amount' => '130.00',
    'paymentMethodNonce' => '7c859da8-fb21-039e-24bb-83f22439a13b',
    'orderId' => '000000010',
    'merchantAccountId' => 'qwpcmnn2h92p5yjk',
    'channel' => 'Magento2_Cart_Community_BT',
    'billing' =>
    array (
      'firstName' => 'Name',
      'lastName' => 'Removed',
      'company' => NULL,
      'streetAddress' => '1926 Address Changed',
      'extendedAddress' => '',
      'locality' => 'Erie',
      'region' => 'PA',
      'postalCode' => '16502',
      'countryCodeAlpha2' => 'US',
    ),
    'shipping' =>
    array (
      'firstName' => 'Name',
      'lastName' => 'Removed',
      'company' => NULL,
      'streetAddress' => '1926 Address Changed',
      'extendedAddress' => '',
      'locality' => 'Erie',
      'region' => 'PA',
      'postalCode' => '16502',
      'countryCodeAlpha2' => 'US',
    ),
    'options' =>
    array (
      'storeInVaultOnSuccess' => true,
      'submitForSettlement' => true,
    ),
    'descriptor' =>
    array (
      'name' => 'Andy\'s Equipment',
      'phone' => '(555) 555-5555',
      'url' => 'andysequipment.com',
    ),
  ),
  'client' => 'Magento\\Braintree\\Gateway\\Http\\Client\\TransactionSale',
  'response' =>
  array (
  ),
) {"is_exception":false} []
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 13, 2017
@YevSent
Copy link
Contributor

YevSent commented Sep 14, 2017

Hi, @McDev814, the outdated curl version might cause such problem. To find an original reason, you need to debug \Braintree\Http::_doUrlRequest method.

The dynamic descriptors are not enabled in the account by default https://developers.braintreepayments.com/reference/request/transaction/sale/php#descriptor and
name should be separated by an asterisk (*) https://developers.braintreepayments.com/reference/request/transaction/sale/php#dynamic-descriptors.

@McDev814
Copy link
Author

McDev814 commented Sep 14, 2017

I've updated curl from version 7.47 to 7.55, though that just broke it even further. After upgrading curl, the payment page is unable to load the payment options. I restored it back to 7.47

I requested from Braintree that they enable dynamic descriptors, though they informed me they were already enabled. After learning more about dynamic descriptors, I decided they were unnecessary in our case, especially if they were causing problems. I cleared all data from the dynamic descriptor settings under Stores->Configuration->Sales->Payment Methods->Braintree->Dynamic Descriptors and cleared the cache. The problem is still persisting, though the debug.log no longer has descriptor information included in the array on failed transactions.

I'm not sure where to start on debugging the \Braintree\Http::_doUrlRequest method, I'm not a php developer. I know enough about programming to know what a method is, but I've never studied or worked with php, do you have any suggestions on how to debug it in the least amount of time given my skill level?

@YevSent
Copy link
Contributor

YevSent commented Sep 15, 2017

You need to use some IDE like PHPStorm and enable xdebug extension for PHP https://www.jetbrains.com/help/phpstorm/2016.3/run-debug-configuration-php-remote-debug.html.
After that, you need to set a breakpoint on https://github.com/braintree/braintree_php/blob/master/lib/Braintree/Http.php#L177 to find original error code and a message from curl response.

@kervin
Copy link

kervin commented Sep 20, 2017

Try to see if it's related to street 2..

#6929

@McDev814
Copy link
Author

Thank you kervin,

I had tried that before posting this, though the problem still persisted. We are having someone add Braintree error logging and are hoping it will be pulled upstream. I know we're not the first ones who could have benefited from knowing what errors are occurring, and I'm sure we won't be the last. I'll update this thread once that development is done and tested.

@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 5, 2017
@ausl
Copy link

ausl commented Oct 10, 2017

i think i have similar issue

@magento-engcom-team
Copy link
Contributor

@McDev814, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Oct 11, 2017
@dipesh-spinx
Copy link

I am having the same issue, Any solution?

@amcguireweb
Copy link

2.4.6 and I'm experiencing the same errors. Still.

[2024-09-24T02:51:27.510781+00:00] report.CRITICAL: Braintree error response. [] []
[2024-09-24T02:51:27.510781+00:00] report.CRITICAL: Braintree error response. [] []
[2024-09-24T02:51:27.511337+00:00] report.CRITICAL: Wrong transaction status [] []
[2024-09-24T02:51:27.511337+00:00] report.CRITICAL: Wrong transaction status [] []
[2024-09-24T02:52:03.137090+00:00] report.CRITICAL: Braintree error response. [] []
[2024-09-24T02:52:03.137090+00:00] report.CRITICAL: Braintree error response. [] []
[2024-09-24T02:52:03.137634+00:00] report.CRITICAL: Wrong transaction status [] []
[2024-09-24T02:52:03.137634+00:00] report.CRITICAL: Wrong transaction status [] []

@simonrl
Copy link

simonrl commented Nov 19, 2024

@amcguireweb seeing the same, did you find a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Payment Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

9 participants