• Resolved philjw

    (@philjw)


    My client upgraded to this version of the plugin in December 2021, and since then fields have been randomly missing from the data sent to Paypal. Orders do seem to go through OK, though there have been random reports of failures too.

    This is an example from Feb 10 (x’s replace client identifying info) where the order items (3 of them) and the customer email were not sent to Paypal, though all are present in the WooCommerce email. It means the email the customer receives from Paypal is often devoid of identifying inforation, which is causing some frustration.

    2022-02-10T21:27:04+00:00 DEBUG PATCH https://api.paypal.com/v2/checkout/orders/XXXXXXXXXXXXXXXXXXXX
    Request Body: [{“op”:”replace”,”value”:{“reference_id”:”default”,”amount”:{“currency_code”:”USD”,”value”:”26.91″},”description”:””,”payee”:{“merchant_id”:”XXXXXXXXX”},”shipping”:{“name”:{“full_name”:”Ann Daaga”},”address”:{“country_code”:”US”,”address_line_1″:”XXX Ct”,”address_line_2″:””,”admin_area_1″:”WA”,”admin_area_2″:”Redmond”,”postal_code”:”XXXXX”}},”custom_id”:”8953″,”invoice_id”:”WC-8953″},”path”:”\/purchase_units\/@reference_id==’default'”}]
    Response Debug ID: b0c0f9773b071
    Response: Array
    (
    [code] => 204
    [message] => No Content
    )

    This is still happening after updating to version 1.6.5.

    I am prepared to instrument the plugin code if that would help figure this out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @philjw,

    There’s a feature in the plugin that drops the order details when there is a subtotal mismatch. If the items were not dropped, then PayPal would likely respond with an API error that prevents the payment from taking place altogether.

    Can you reproduce this behavior in any reliable way or does it just occur seemingly randomly? If we understand how this could be reproduced, then we can more reliably find a solution. Thanks!

    Kind regards,
    Niklas

    Thread Starter philjw

    (@philjw)

    Hi Niklas,

    I don’t think we are experiencing any subtotal mismatches. We have not yet found a pattern either.

    I have dozens of examples, but obviously have to be careful to protect customer information.

    This is the plugin log for order 8529. This was missing product information and an email address.

    [{“op”:”replace”,”value”:{“reference_id”:”default”,”amount”:{“currency_code”:”USD”,”value”:”14.65″},”description”:””,”payee”:{“merchant_id”:”xxxxxxxxx”},”shipping”:{“name”:{“full_name”:”**xxxx**”},”address”:{“country_code”:”US”,”address_line_1″:”123 xyxyxyx”,”address_line_2″:””,”admin_area_1″:”WA”,”admin_area_2″:”Shelton”,”postal_code”:”98123″}},”custom_id”:”8529″,”invoice_id”:”WC-8529″},”path”:”\/purchase_units\/@reference_id==’default'”}]

    One thing I do notice is how complex the tax calculations are in Washington state, where every town seems to have its own tax rate. Is this likely to be related do you think? On this order for example, the tax on an item (quantity=3) was $1.15 on $13.50.

    Could you extend the logging to record when information is being dropped and why? It won’t take long to get results.

    Thank you!

    – Phil

    Thread Starter philjw

    (@philjw)

    Hi Niklas,

    I instrumented the plugin, and this is indeed the cause of the lost order items.

    For the order I examined, the tax rate was 10.1% on 4 items costing $4.5 each.

    WooCommerce seems to have calculated the tax to more decimal places or calculated the item total ($18) first before applying the tax.

    The data WooCommerce Paypal Payments works with is a per item tax rounded up and then multiplied by the item count.

    It seems that just dropping the order details is somewhat overkill. What data do you get to work with? Can you calculate the tax on the total rather that the individual items? Or just adjust the total (amount_total in the ditch_items_when_mismatch function) to match amount_value?

    The order dropped the email too, but there was a billing email to work with.Can you address that too?

    If this is not your responsibility, can you tell me who I should contact?

    Thanks and regards,

    – Phil

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fields randomly missing from the data sent to Paypal’ is closed to new replies.