Support » Plugin: GiveWP - Donation Plugin and Fundraising Platform » UncaughtException – Revenue.php

  • Resolved jononoy

    (@jononoy)


    Having an issue processing a donation via Stripe using MultiStep Form. The below error is dropping into the PHP Error Log. The form displays just the loading symbol following entering CC Details.
    Have already re-run the Revenue table database update but not made any difference.

    Am I missing something?

    Cheers, Jono

    [23-Aug-2022 06:01:28 UTC] PHP Fatal error: Uncaught Give\Framework\Exceptions\Primitives\InvalidArgumentException: An error occurred when processing Donation #11233. To insert revenue, please provide valid donation_id, form_id, amount. in /home/aflssq/public_html/wp-content/plugins/give/src/Revenue/Repositories/Revenue.php:96
    Stack trace:
    #0 /home/aflssq/public_html/wp-content/plugins/give/src/Revenue/Repositories/Revenue.php(32): Give\Revenue\Repositories\Revenue->validateNewRevenueData(Array)
    #1 /home/aflssq/public_html/wp-content/plugins/give/src/Revenue/DonationHandler.php(30): Give\Revenue\Repositories\Revenue->insert(Array)
    #2 [internal function]: Give\Revenue\DonationHandler->handle(11233)
    #3 /home/aflssq/public_html/wp-content/plugins/give/src/Helpers/Hooks.php(43): call_user_func_array(Array, Array)
    #4 /home/aflssq/public_html/wp-includes/class-wp-hook.php(309): Give\Helpers\Hooks::Give\Helpers\{closure}(11233)
    #5 /home/aflssq/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #6 /home/aflssq/public_html/wp-in in /home/aflssq/public_html/wp-content/plugins/give/src/Revenue/Repositories/Revenue.php on line 96`

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ben Meredith

    (@benmeredithgmailcom)

    Hey @jononoy

    Well that’s certainly not what we want.

    What’s going on here is some sort of database issue preventing storing the revenue, which is stopping the database update from running. I’m not sure at all if that’s related to the donation not going through, though. We’ve seen that issue in the past, and it’s unrelated to donation processing completely. So while we do want to resolve that database-related error, I’m more keen to focus on what might be causing donations to fail.

    First: Is donation 11233 a new donation or an older one?

    Next: are you seeing the donation at the payment gateway at all?

    Also: are any of the logs related to Payment Errors, as opposed to

    The fix for the error in your message is straightforward:

    Check in your donations list for any donation that does not have an associated donation form, and add a form to it (or delete that donation) and you should be all set. Once all of them are associated with a form, that database update will run.

    Thread Starter jononoy

    (@jononoy)

    Hey @benmeredithgmailcom

    Thanks for getting back to me!

    We’ve tried processing Donations both in and out of test mode – no change. The Logs in the Stripe Dashboard are showing contact from the site but there are no funds being captured or any payment (even failed) showing up in Stripe at all. Just logs/events related to the API & Webhook.

    Donation #11233 is a new one I attempted yesterday. And, the form (ID#11228) is already listed against the donation. The 2 donations I have in there currently (the rest have been deleted) are Test ones and showing the status as Pending.

    Just tried another with the console open and see I get a ‘500’ error.
    POST https://xxxxxxxxxx/give/11228/?payment-mode=stripe_checkout&form-id=11228 [HTTP/2 500 Internal Server Error 625ms]

    **Can confirm the Site is running on PHP8.1 with a decent amount of PHP Memory allocated. Was previously running PHP7.4 but upgraded as part of troubleshooting.

    Plugin Support Rick Alday

    (@mrdaro)

    Hi @jononoy,

    The most common database table for this issue is wp_give_revenue (my database prefix is wp_, yours may be different). In your System Info the database tables should all have a green checkmark beside them – or a red X if they are missing. Here’s a screenshot of what mine looks like:
    https://screencast-o-matic.com/i/c3jTqIVTw4c

    If wp_give_revenue is missing, please do the following:

    1. First, I’d recommend taking a backup of the site that you can confidently restore from. Here’s an article we wrote that explains more clearly how to do that: https://givewp.com/backup-for-faster-troubleshooting/
    2. Next, enable Advanced Database Updates in Donations > Settings > Advanced.
    3. Next, run the update in Donations -> Tools -> Data, and based on the Run Order columns, re-run the create_revenue_table update. If you notice any pending updates, run them as well.
    4. Check the logs at Donations > Tools > Logs for errors. If there are any errors, pass those along here.
    5. Last, navigate back to Donations > Settings > Advanced and disable Advanced Database Updates.

    If that doesn’t fix the issue, your System Info will help me a bit.

    Thread Starter jononoy

    (@jononoy)

    Hey Rick,

    Cheers for that. I can confirm all the tables look good – all green ticks. I had already re-run the create_revenue_table update to troubleshoot anyway. And yep, the DB prefix is different. There are a ton of errors in the logs, all the same as below.

    I’ve flicked you an email to your hello[at]… address with some further screenshots and System Info too.

    {
        "exception": {
            "File": "Revenue.php",
            "Line": 96,
            "Message": "An error occurred when processing Donation #11252. To insert revenue, please provide valid donation_id, form_id, amount.",
            "Code": 0
        }
    }

    Cheers, Jono

    Plugin Support Rick Alday

    (@mrdaro)

    Hi Jono,

    Can you reach out to us via our contact form: https://givewp.com/contact-us/
    From the “Subject of your Inquiry” dropdown, select “I am responding to a request to contact you”.
    Reference this ticket in the message.

    If you can also check what “engine” your database table use that would be helpful.
    The engine can either be MyISAM or InnoDB.

    Thanks!

    Plugin Support Matheus Martins

    (@matheusfd)

    Hey, @jononoy.

    We will mark this post as resolved while we work on it via priority support. We will update this post with our findings.

    Thanks for using GiveWP! Have a great day.

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