3

We are facing an issue that the transaction is being created twice on Braintree and our clients have been charged twice.

What we found is that the TransactionTime on Braintree is the same for when the order is created (first transaction) and when the order is shipped (second transaction).

comments status

Here is the first transaction on the Braintree panel (the right one): enter image description here

Here is the second transaction on the Braintree panel (duplicated): enter image description here

  • I configured the Braintree to Authorize and Capture
  • If you repair on the second image you'll see that there is no orderId setted on Braintree transaction.
  • Both transaction type is sale
  • Braintree and my Magento comments on panel has 2 hours timezone difference
  • Magento version 2.2.8 (it was upgraded recently from 2.2.6)
2

Braintree Duplicate checking logic

Our duplicate checking logic runs within a specific time frame. If all of the general and relevant payment method-specific conditions are met within the designated timeframe, any suspected duplicate transactions will be Gateway Rejected.

The timeframe for duplicate checking logic is set to 30 seconds by default, but can be updated to meet your needs in the Control Panel.

General conditions for Duplicate Transaction

In order for a transaction to be Gateway Rejected as a duplicate transaction, it must meet all of the following conditions within the designated timeframe:

  • Amount is the same as the initial transaction
  • Order ID is the same (if collected and if the transaction was not created by Braintree's recurring billing functionality)
  • Subscription ID is the same (if the transaction was created by Braintree's recurring billing functionality)
  • The initial transaction was successful (status can be Authorized, Submitted for Settlement, Settling, Settled, or Voided)

Payment method-specific conditions

In addition to the general conditions listed above, there are conditions specific to supported payment methods. For the following payment methods, the listed condition must also be true in order for our duplicate transaction logic to reject the transaction:

  • Google Pay or Apple Pay – DPAN is the same
  • PayPal – payer email address is the same
  • Credit card – number and expiration date are the same

Configuring duplicate transaction checking

Duplicate transaction checking is enabled by default with a 30 second window in both the sandbox and production environments. These settings can be updated or disabled by users with Account Admin permissions.

  1. Log into the Control Panel
  2. Navigate to Settings > Processing > Duplicate Transaction Checking
  3. Click the toggle to turn this feature on and off, or click Options to adjust the time window

Reference: https://articles.braintreepayments.com/control-panel/transactions/duplicate-checking

I hope this will help

  • I tried those configurations but the order id is not set on the second transaction and the second transaction is created more than one hour of difference more. We are going to install the Gene module and see if that updated version should fix that. I'll post an answer if it works. Anyway, thanks for the complete answer and to share all those functions from Braintree. – andrewdaluz Apr 18 at 13:58
  • It's rare issue. +1 for posting question it helps others as well. Though I try to cover all aspects. – Muhammad Hasham Apr 18 at 14:12
  • @MuhammadHasham really nice and detailed answer. +1 for your effort. – Muhammad Anas Apr 18 at 14:14
2

After a few days investigating that problem, we had a conversation with the client to understand how they were shipping the orders then we found out they use ShippingEasy integration to ship the orders. Then I went to their ShippingEasy panel and I found that configuration:

enter image description here

And that option is related to that function: https://support.shippingeasy.com/hc/en-us/articles/208183303

That function says:

Request that ShippingEasy prompt Magento to capture the funds for your orders on shipment creation.

So when the client was shipping the orders trough ShippingEasy that integration was requesting to capture the payment again.

Anyway, I believe that Magento should not allow a capture request if the order is already invoiced/captured.

I'll let that message for future information if it helps anyone else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.