- This topic has 4 replies, 2 voices, and was last updated 1 year ago by subrata.
-
AuthorPosts
-
September 19, 2023 at 3:36 pm #4756Think ZapParticipant
Hi Guys,
We have installed your plugin on a few of our sites and have found a major issue with balances not being updated after a order has been completed.
When a users goes to make an order and checkouts with another payment method first, then changes there mind and presses the browser back button to then select TeraWallet and checkout using this, the balance for that order is not removed from the users total. This gives them the ability to abuse the checkout process and not pay for any orders.
Please could you get back to use when this can be looked into as currently is a big exploit in the checkout process.
Many Thanks
September 25, 2023 at 7:07 pm #4780subrataKeymasterThanks for reaching out. We check this in our local setup and it is working fine. Could you please let us know which payment method you are using to place the order before placing with wallet credit?
October 5, 2023 at 4:21 pm #4815Think ZapParticipantHi Subrata,
The issue is with the Cashflows plugin:
https://wordpress.org/support/topic/terawallet-conflict-with-latest-version/What is happening is that Cashflows is setting a transaction ID when the user begins a payment flow (before the payment is complete). The user can cancel the payment, return to checkout, and then proceed with Tera.
class-woo-wallet-payment-method.php Ln 158 is checking for a transaction ID (! $order->get_transaction_id( ‘edit’ )). As this is set by cashflows, the statement is returning false, and the order can proceed without deducting payment from the user’s balance:
if ( 'wallet' === $order->get_payment_method( 'edit' ) && ! $order->get_transaction_id( 'edit' ) && $order->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_payment_complete', array( 'on-hold', 'pending', 'failed', 'cancelled' ), $order ) ) ) { ... }
I’ve managed to fix this by removing the transaction ID from the order if it is in pending payment status when a payment request is sent via Tera:
Ln 127: public function process_payment( $order_id ):
// Clear ID when previous payment attempt failed. if ( $order->has_status( 'pending' ) && $order->get_transaction_id( 'edit' ) ) { $order->set_transaction_id( '' ); $order->save(); }
This seems to be working.
Let me know if you need any further clarification. Thanks for your help!
October 6, 2023 at 5:33 pm #4825Think ZapParticipantFYI, Cashflows have fixed the issue at their end by saving their transaction ID to meta instead of setting the WC transaction ID.
However, it’s worth keeping this issue in mind if other gateways also set the transaction ID too early.
Many thanks!
October 7, 2023 at 11:46 am #4830subrataKeymasterThanks for letting us know.
-
AuthorPosts
- You must be logged in to reply to this topic.