magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.53k stars 9.31k forks source link

Cancelling a Braintree order after Authorization Expires fails #13433

Closed AndrewPenry closed 6 years ago

AndrewPenry commented 6 years ago

Preconditions

  1. Magneto 2.1.10 with Sample Data
  2. PHP 7.0
  3. Braintree Payments

Steps to reproduce

  1. In Stores>Configuration>Sales>Payment Methods, configure Braintree to use "Authorize" as the Payment Action
  2. Place an order using Braintree Credit Card.
  3. Wait until the authorization expires (7 days for AmEx, 10 days for Visa).
  4. Cancel or Void the order

Expected result

  1. The order should be cancelled or voided.

Actual result

  1. Error: "Transaction has been declined. Please try again later."

I suspect that the Braintree module receives an error from Braintree because the Transaction ID has expired and then fails. However, it should be able to know that the error is due to the id being expired and allow the cancellation or void in Magento. Because it does not allow the cancellation, orders that have an expired authorization are stuck in "Processing" forever,

AndrewPenry commented 6 years ago

An extra note: If you invoice or ship an order with an expired authorization, the order is reauthorized with a new transaction ID and then immediately captured, which is the correct behavior. Authorization expiration seems to only negatively impact orders that you ultimately cancel.

kshaa commented 6 years ago

Can confirm, having the same issue with the same preconditions. Can also reproduce with Braintree PayPal payments.

joni-jones commented 6 years ago

Hi, @AndrewPenry, this is known issue (internal ticket MAGETWO-89221). Thanks for reporting.

danmentzer commented 6 years ago

Any news on this issue @joni-jones ? I am also experiencing this issue.

joni-jones commented 6 years ago

Hi, @danmentzer, the fix already merged to 2.2-develop and will be available in Magento 2.2.6 release.

danmentzer commented 6 years ago

Hi @joni-jones , Thank you for getting back to me so quickly.

congson95dev commented 4 years ago

Hi @joni-jones Do you have a patch for this? i'm in magento version 2.1.10.

AlexWorking commented 2 years ago

@all Hi there. I have this issue reproduced on 2.4.3 . Can anyone give me a link to the fixing commit?

swhall commented 2 years ago

@joni-jones This is still an issue in Magento version 2.4.3-p1. Any known solutions?