No announcement yet.

WooCommerce C&P Gateway Transaction Amounts Don't Match Order Total

  • Filter
  • Time
  • Show
Clear All
new posts

  • WooCommerce C&P Gateway Transaction Amounts Don't Match Order Total

    Hello –

    I have a client (I am their web developer) which has been using C&P for a few years at least, including as the payment processor on their website which uses WooCommerce for an online store.

    Recently we ran into an issue, after starting to use the WooCommerce Bookings plugin to accept payment for event time slots. The issue was that the amount charged to the customer in the C&P transaction did NOT match the order data.

    I dug into the code of the WooCommerce Click & Pledge Gateway plugin, and believe I found why this issue is happening. The plugin appears to do its own recalculation of item/order totals while building up the XML transaction request, rather than using the amounts/totals available in the order data.

    In doing so, any functionality outside of core WooCommerce prices gets missed. The Bookings plugin has some functionality which adjusts a base price given date/time ranges, and that logic/calculation isn't reflected in the amount C&P charges in the transaction.

    For example, with a $25 booking which is reduced by $15 on the last day of a range, the order total would be $10. This is all displayed and reflected perfectly in the cart, checkout, and resulting order, but the C&P transaction still charges $25.

    I see there is at least one case where the plugin looks for and handles some functionality beyond core WooCommerce pricing, for the "Name Your Price" plugin.

    I am hoping that you can either:

    A) Update the plugin to account for the logic of WooCommerce Bookings, like you do with Name Your Price.

    or perhaps better:

    B) Update the plugin to use order/item totals from the WooCommerce order object, rather than recalculate your own totals, so that this sort of issue isn't an issue in the first place.

    Is this possible?

    Is there any additional information I can provide to assist with resolving this?

    Thank you!