Incorrect Remaining Balance in Debit Entry

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #8690
    sanjay.modi
    Participant

    Hello Tera Wallet Team,
    We are observing an incorrect remaining balance calculation issue in wallet debit entries. Below is a detailed example for your reference:
    Scenario / Steps:
    User wallet balance was ₹0
    User performed a recharge of ₹25
    User initiated a chat session
    Chat ended with a total deduction of ₹23.60000000
    Expected Calculation:
    Recharge Amount: ₹25.00
    Chat Deduction: ₹23.60000000
    Expected Remaining Balance: ₹1.40000000
    Actual Issue Observed:
    Debit Entry Amount: ₹23.60000000 (Correct)
    Remaining Balance shown in debit entry: ₹26.40000000 (Incorrect)
    Instead of showing ₹1.40, the system is reflecting ₹26.40 as the remaining balance, which is logically incorrect.

    Please let us know if logs, transaction IDs, or additional details are required from our side.

    MY code of debit api call back function

    public function debitCustomerWalletAmountCallBackFun($request)
    {
    // Verify API token
    $apiVerify = $this->helper->verifyApiToken();
    if (!empty($apiVerify[‘message’])) {
    return $this->helper->generateResponse($apiVerify, $this->helper->UNAUTHORIZED);
    }
    // Extract request parameters
    $customerId = $request[‘customerId’];
    $debitAmount = $request[‘debitAmount’];
    $commentMsg = $request[‘commentMsg’];

    // Debit the customer’s wallet
    woo_wallet()->wallet->debit($customerId, $debitAmount, $commentMsg);
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Login

Register

A link to set a new password will be sent to your email address.

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