Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4756
    Think Zap
    Participant

    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

    #4780
    subrata
    Keymaster

    Thanks 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?

    #4815
    Think Zap
    Participant

    Hi 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!

    #4825
    Think Zap
    Participant

    FYI, 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!

    #4830
    subrata
    Keymaster

    Thanks for letting us know.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Login

Register

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

WhatsApp

get a quote