Support » Plugin: WooCommerce Square » CRITICAL Uncaught Error: Call to a member function getTransaction()

  • Resolved Stanko Metodiev

    (@metodiew)


    Hey guys,

    we have a Critical error in our error log, in fact, two just today:

    2019-12-27T12:03:44+00:00 CRITICAL Uncaught Error: Call to a member function getTransaction() on string in /dom27602/wp-content/plugins/woocommerce-square/includes/Gateway/API/Responses/Charge.php:137
    Stack trace:
    #0 /dom27602/wp-content/plugins/woocommerce-square/includes/Gateway/API/Responses/Charge.php(85): WooCommerce\Square\Gateway\API\Responses\Charge->get_transaction()
    #1 /dom27602/wp-content/plugins/woocommerce-square/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php(753): WooCommerce\Square\Gateway\API\Responses\Charge->get_transaction_id()
    #2 /dom27602/wp-content/plugins/woocommerce-square/vendor/skyverge/wc-plugin-framework/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php(795): SkyVerge\WooCommerce\PluginFramework\v5_4_0\SV_WC_Payment_Gateway_Direct->do_credit_card_transaction(Object(WC_Order))
    #3 /dom27602/wp-content/plugins/woocommerce-square/includes/Gateway.php(315): SkyVerge\WooCommerce\PluginFramework\v5_4_0\SV_WC_Payment_Gateway_Direct->do_transaction(Obje in /dom27602/wp-content/plugins/woocommerce-square/includes/Gateway/API/Responses/Charge.php on line 137

    Part of the system log:

    ### WordPress Environment ###
    WC Version: 3.8.1
    REST API Version: ✔ 1.0.2
    Log Directory Writable: ✔
    WP Version: ❌ 5.2.5 – There is a newer version of WordPress available (5.3.2)
    WP Multisite: ✔
    WP Memory Limit: 3 GB
    WP Debug Mode: –
    WP Cron: –
    Language: en_US
    External object cache: –

    ### Server Environment ###

    Server Info: Apache
    PHP Version: 7.3.11-1+ubuntu16.04.1+deb.sury.org+1
    PHP Post Max Size: 100 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 10000
    cURL Version: 7.47.0
    OpenSSL/1.0.2g

    SUHOSIN Installed: –
    MySQL Version: 5.6.44-log
    Max Upload Size: 25 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔

    ### Security ###

    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔

    ### Active Plugins (28) ###

    ### Settings ###

    API Enabled: –
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    ### Square ###

    Environment: Production
    Tokenization Enabled: –
    Debug Mode: Save to Log

    ### Action Scheduler ###

    Complete: 9
    Oldest: 2019-11-27 23:05:58 +0000
    Newest: 2019-12-25 23:14:04 +0000

    Pending: 2
    Oldest: 2019-12-30 10:04:51 +0000
    Newest: 2020-01-01 23:14:04 +0000

    Canceled: 1
    Oldest: 2019-12-23 10:04:13 +0000
    Newest: 2019-12-23 10:04:13 +0000

    In-progress: 0
    Oldest: –
    Newest: –

    Failed: 0
    Oldest: –
    Newest: –`

    I can see a number of other tickets with complains about fatal errors and the like. Do you test the plugin before releasing a new version, as we are talking about a payment gateway, not a random shortcode plugin?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hari Shanker R

    (@harishanker)

    Automattic Happiness Engineer

    Hi @metodiew

    I understand that you’re running into these weird critical errors with the Square plugin which you use for payments. It’s definitely a huge bummer to have these errors pop-up and that too over the holiday season. Let’s see how we can fix these problems.

    I tried testing this with the latest version of Square (2.0.8) along with the latest versions of WooCommerce (3.8.1) and WordPress (5.3.2). I was not able to find any errors as such. I tried doing test transactions, and they went fine as well. With this background, I’m not so sure if the problem is with the Square plugin itself.

    I pored over the system status report you shared to see if I could isolate something that might trigger the problem. You’ve not included the list of plugins in your site, so I’m not sure if you’re on the latest version of Square. Can you update to the latest version (2.0.8), in case you haven’t, and then try disconnecting + reconnecting Square and try checking if you keep running into these problems?

    In case the problem still persists, I’d appreciate it if you could do a full conflict test. This is likely caused by a conflict with your theme or with another plugin.

    The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront (https://woocommerce.com/storefront/?aff=10486&cid=1131038) and disable all plugins except for WooCommerceand Square. Finally, test to see if the issue is resolved by check if you still keep seeing the Critical Error.

    To figure out which plugin is causing the problem, continue to the next step – reactivate your other plugins one by one, testing after each, until you find the one causing conflict.

    Here’s a more extensive explanation in our docs: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Tools to help you troubleshoot:

    You can clone your site to a staging environment and perform tests without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin. Link: https://wordpress.org/plugins/wp-staging/

    If you still keep running into troubles, we’d be glad to take a better look at this for you. Can you create a ticket with us by visiting https://woocommerce.com/my-account/create-a-ticket?

    We hope to get to the bottom of this soon. Thanks!

    Plugin Support Jess L

    (@jlundie)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, please go ahead and start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CRITICAL Uncaught Error: Call to a member function getTransaction()’ is closed to new replies.