PayPal Commerce - Duplicate order, one payment

11 ay önce
NOP 4.60.4, plugin NOP PayPal Commerce 1.16 (Payment type: Capture)

Although it has only occurred once so far, we recently had a PayPal Commerce payment that resulted in 2 paid, virtually identical orders being created when the customer only created one.

It was an order with 68 products on it (all with product attributes customisable text and several with images uploaded), and it was still processing the order after payment, when the second order was created.

Both orders have the same "Capture transaction ID" (e.g. 9M999999L9999999V) and "Custom values" (e.g. PayPal order ID: 9RP99999UN9999999) and both have the same "Order GUID" (Order table OrderGuid field). The OrderItem table has 68 records for each of the 2 orders, with unique OrderItemGuid's, as expected.

Order 1
11:36:13 - Order Created timestamp
11:36:36 - Webhook from PayPal logged in Order Notes
6 minutes elapsed (nothing mentioned in Event Viewer logs during this time)
11:42:08 - Order placed logged in Order Notes
11:42:08 - "Order status has been changed to Processing" logged in Order Notes
11:42:09 - "Order paid" email queued logged in Order Notes

Order 2
11:38:12 - Order Created timestamp
(no webhook logged in Order Notes)
11:38:14 - Order placed logged in Order Notes
11:38:14 - "Order status has been changed to Processing" logged in Order Notes
11:38:14 - "Order paid" email queued logged in Order Notes

It looks like something triggered the second order to be created after exactly 2 minutes (perhaps as the first was taking a long time, although it eventually completed successfully with nothing, e.g. deadlocks mentioned in the event log)

As it has only occurred once in 6+ months, it is not a major issue, but there is clearly a way for orders to be duplicated with only one payment. I have not been able to replicate the issue - perhaps something on the server caused the slow processing of the first order that caused the issue to occur, but I thought it worth reporting the fact that it occured, in case someone else has the same problem.

11 ay önce
Thanks for this detailed report.
We're going to significantly improve PayPal Commerce plugin soon, as well as solve all possible issues, so we expect such errors to not happen again.
3 hafta önce
This still occurs with the PayPal Commerce commerce plugin 1.26.

One payment, 2 orders. Images uploaded with the orders have the same URL, eg: https://www.<witheld>.com/download/getfileupload/?downloadId=3ec14461-e467-456d-88d0-5df3db4fc04d

Again a fairly large order with 13 image uploads and multiple product attributes selected (customised goods where there are drop down lists and text boxes for each item ordered), so maybe it's due to the processing time taking a long time.

1st order notes:
09/05/2025 07:54:59  "Order paid" email (to customer) has been queued. Queued email identifiers: 30349.  No file attached    
09/05/2025 07:54:59  Order status has been changed to Processing  No file attached    
09/05/2025 07:54:59  Order has been marked as paid  No file attached    
09/05/2025 07:54:56  Order placed  No file attached    

2nd order notes:
09/05/2025 07:55:26  Order placed  No file attached    
09/05/2025 07:55:11  "Order paid" email (to customer) has been queued. Queued email identifiers: 30350.  No file attached    
09/05/2025 07:55:11  Order status has been changed to Processing  No file attached    
09/05/2025 07:55:11  Order has been marked as paid  No file attached    
09/05/2025 07:55:11  Webhook details:
{
  "id": "WH-76L768668G872802N-71306483GM7377800",
  "event_version": "1.0",
  "create_time": "2025-05-09T06:54:57.03Z",
  "resource_type": "capture",
  "resource_version": "2.0",
  "event_type": "PAYMENT.CAPTURE.COMPLETED",
  "summary": "Payment completed for £ 420.05 GBP",
  "resource": {
    "id": "0UX18420KP341190F",
    "amount": {
      "currency_code": "GBP",
      "value": "420.05"
    },
    "final_capture": true,
    "seller_protection": {
      "status": "ELIGIBLE",
      "dispute_categories": [
        "ITEM_NOT_RECEIVED",
        "UNAUTHORIZED_TRANSACTION"
      ]
    },
    "seller_receivable_breakdown": {
      "gross_amount": {
        "currency_code": "GBP",
        "value": "420.05"
      },
      "paypal_fee": {
        "currency_code": "GBP",
        "value": "5.34"
      },
      "net_amount": {
        "currency_code": "GBP",
        "value": "414.71"
      }
    },
    "invoice_id": "T10865",
    "custom_id": "097aa537-17ba-4f10-a36a-131bd8c7bd86",
    "status": "COMPLETED",
    "supplementary_data": {
      "related_ids": {
        "order_id": "1GD770981W7398806"
      }
    },
    "payee": {
      "email_address": "<withheld>",
      "merchant_id": "<withheld>"
    },
    "create_time": "2025-05-09T06:54:51Z",
    "update_time": "2025-05-09T06:54:51Z",
    "links": [
      {
        "href": "https://api.paypal.com/v2/payments/captures/0UX18420KP341190F",
        "rel": "self",
        "method": "GET"
      },
      {
        "href": "https://api.paypal.com/v2/payments/captures/0UX18420KP341190F/refund",
        "rel": "refund",
        "method": "POST"
      },
      {
        "href": "https://api.paypal.com/v2/checkout/orders/1GD770981W7398806",
        "rel": "up",
        "method": "GET"
      }
    ]
  },
  "links": [
    {
      "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-76L768668G872802N-71306483GM7377800",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.paypal.com/v1/notifications/webhooks-events/WH-76L768668G872802N-71306483GM7377800/resend",
      "rel": "resend",
      "method": "POST"
    }
  ]
}

System log entry:
Short message
Payments.PayPalCommerce error:
Failed request
Full message
Nop.Core.NopException: Failed request (UnprocessableEntity): The requested action could not be performed, semantically incorrect, or failed business validation.
{
  "name": "UNPROCESSABLE_ENTITY",
  "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
  "debug_id": "ff8cad6208e37",
  "details": [
    {
      "field": null,
      "value": null,
      "location": null,
      "issue": "ORDER_ALREADY_COMPLETED",
      "description": "The order cannot be patched after it is completed."
    }
  ],
  "links": [
    {
      "title": null,
      "href": "https://developer.paypal.com/api/rest/reference/orders/v2/errors/#ORDER_ALREADY_COMPLETED",
      "method": "GET",
      "rel": "information_link",
      "encType": null,
      "mediaType": null
    }
  ]
}
IP address
86.10.47.38
Customer
Guest
Page URL
https://www.<withheld>.com/PayPalCommercePublic/ConfirmOrderPost
Referrer URL
https://www.<withheld>.com/paypal/confirm-order?orderId=1GD770981W7398806
Created on
09/05/2025 07:55:26

3 hafta önce
Thanks again. Could you please provide a full list of steps to reproduce this error?
3 hafta önce
I have tried replicating the issue but have had no success.

Once the order is confirmed, it takes 30+ seconds to complete it (12 items on the latest order that had the issue, each with two product attributes  (drop down list selection and a multiline text box).

I suspect it is something to do with the fact that the order is taking so long to complete once confirmed and it is taking the payment and creating the order. Orders with only a few items on take only a couple of seconds or so to complete, and the issue has never happened on orders with under 10 items.