Support » Plugin: WooCommerce PayPal Payments » Duplicate Invoice ID error

  • Resolved sambodinho

    (@sambodinho)


    Hi,

    I’m getting the following error when I try to pay via Paypal. Credit card checkout via PayPal Card Processing works fine. But once that’s been done the same customer cannot purchase the same product using Paypal due to this error. I’m not sure how to get a unique invoice ID to be issued during the transaction?

    Thanks in advance,
    Sam

    [UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-DUPLICATE_INVOICE_ID

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Inpsyde Niklas

    (@niklasinpsyde)

    Hi @sambodinho,

    Whoops, that may have been sent a bit too early!
    Anyway, you may want to perform a full conflict test to rule out eventual issues with the theme or a different plugin. We recommend temporarily activating the default theme Storefront and disabling all other plugins except for WooCommerce and PayPal Payments to see if the behavior persists.
    Thanks!

    Kind regards,
    Niklas

    • This reply was modified 10 months, 1 week ago by Inpsyde Niklas. Reason: accidental submit
    Thread Starter sambodinho

    (@sambodinho)

    Ah, you’ve helped find the problem, thank you. After going through each plugin and the child theme I’ve realised it’s a function in my child theme causing the conflict. I have a function which changes the order ID to a name. Paypal obviously doesn’t like that and wants numbers instead of letters. At least I know what was causing the issue. Now I need to find a way to be able to change the order ID for the customer but not for Paypal…

    Plugin Support Inpsyde Niklas

    (@niklasinpsyde)

    Hi @sambodinho,

    One of next updates implements a filter that allows modifying the PayPal order data. Here is an example:
    https://github.com/woocommerce/woocommerce-paypal-payments/wiki/Actions-and-Filters#modify-the-order-creation-request-body-data
    By default, PayPal Payments creates a PayPal order with the invoice prefix from the plugin settings and the WooCommerce order number. The filter can set a different invoice id at PayPal compared to WooCommerce. So if you apply your invoice logic in WooCommerce and then change the behavior for the PayPal order with another filter, it may not cause the conflicting behavior.
    I hope this helps!

    Kind regards,
    Niklas

    Thread Starter sambodinho

    (@sambodinho)

    Fab, thanks!

    Plugin Support Inpsyde Niklas

    (@niklasinpsyde)

    The filter mentioned above did not make it for yesterday’s 1.7.1 update and will presumably be included in the next update. But applying it manually shouldn’t be too tricky, as it’s only a single line.
    If any questions remain or if you have any other feedback, you can always let us know.
    Thank you!

    Kind regards,
    Niklas

    Plugin Support Joost van de Vijver

    (@joostvandevijver)

    Hello,

    It has been quite some time since our last communication, so we will mark this thread as resolved. Please open a new thread if you are still facing issues or have questions that you need us to answer.

    Kind regards,
    Joost

    We have this issue still every day since months. And the customers must have to switch zu pay with an other payment gateway. Why is this not possible to fix?

    2022-06-15T10:38:37+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders/20S62025PN46xxxxx/capture
    Response Debug ID: ea7e2566dxxxx
    Response: Array
    (
        [code] => 422
        [message] => Unprocessable Entity
    )
    
    Response Body: {"name":"UNPROCESSABLE_ENTITY","details":[{"issue":"DUPLICATE_INVOICE_ID","description":"Duplicate Invoice ID detected. To avoid a potential duplicate transaction your account setting requires that Invoice Id be unique for each transaction."}],"message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"ea7e2566dxxxx","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-DUPLICATE_INVOICE_ID","rel":"information_link","method":"GET"}]}
    
    2022-06-15T10:38:37+00:00 WARNING Failed to capture order. PayPal API response: [UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-DUPLICATE_INVOICE_ID
    Plugin Support Joost van de Vijver

    (@joostvandevijver)

    Hello @fox-didl

    We don’t provide support on closed threads, so please open a new thread and provide more details on the situation. We would like to see the system report as well as the full logs of these failures.

    If you don’t feel comfortable sharing those details on a public forum, please open a ticket with our service desk. You can find the instruction for this here: https://paypal.inpsyde.com/docs/request-support/
    (please add the URL of this thread in the ticket as well)

    Kind regards,
    Joost

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Duplicate Invoice ID error’ is closed to new replies.