VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
139 stars 162 forks source link

Smart checkout plugin for woocommerce/_transaction_id Becomes NULL and Order Status Code is Updated Early #2383

Closed grg4 closed 1 year ago

grg4 commented 1 year ago

Smart checkout plugin for woocommerce I have identified two possible bugs in the check_ipn_response function of the Viva Wallet Smart Checkout payment gateway plugin for WooCommerce when I tried to collect order data after woocommerce_orderstatus hook triggering.

Firstly, the $tm_ref variable is defined within an if statement https://github.com/VivaPayments/API/blob/5120054a274f1bf4ab15633132bc7b1d67976274/Plugins/vivawallet-woocommerce-gateway/wc-vivawallet.php#L508 and then used in another if statement to update the WooCommerce order https://github.com/VivaPayments/API/blob/5120054a274f1bf4ab15633132bc7b1d67976274/Plugins/vivawallet-woocommerce-gateway/wc-vivawallet.php#L671 Due to this, the _transaction_id in the database table wp_options is set to NULL. To fix this, you need to use $OrderCode variable to update the order data within the if statement of webhook.

Secondly, the order status code in the database is updated before the update of order data. As a result, when the woocommerce_order_status_processing hook is triggered, the order data is incomplete. You need to ensure that the order data is updated before updating the order status code.

I hope this helps you to identify and fix the bugs.

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

Thank you for your message. We will review your comments. We always consider our customers' feedback for future improvements.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

We just wanted to follow up on the reply we sent yesterday. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

grg4 commented 1 year ago

Hello, Thank you for your earlier response. However, I was hoping for a solution to my issue, whether it be a fix, a workaround, or clarification that my findings were incorrect. If you are unable to provide assistance, please let me know so that I can close this issue. Otherwise, I will wait for your response.

Thank you.

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

Thank you for your message. We will investigate this issue. As soon as we have any updates, we will inform you.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

Thank you for waiting. We are currently working on releasing a new plugin. It will soon be available, In the meantime, you can of course edit the code since it is openly available.

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

We just wanted to follow up on the reply we sent yesterday. We were simply wondering if you read our response.

In any case this ticket will remain active for at least 24 hours, so that you can come back if you wish.

However, if you have any questions, please don't hesitate to reply here and we'd be happy to help!

Kind regards, Viva Wallet E-commerce Support Team

VivaWalletCustomerSupport commented 1 year ago

Hello @grg4,

This ticket will close for now. Please don't hesitate to raise a new ticket if you need further assistance.

Kind regards, Viva Wallet E-commerce Support Team