• Resolved teevee98

    (@teevee98)


    I received following error today, when I wanted to push a invoice.

    Any idea what this means in human language?

    Error Details

    =============

    An error of type E_ERROR was caused in line 2009 of the file /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php. Error message: Uncaught WCPay\Exceptions\API_Exception: Error: Sorry, you cannot access this resource. in /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php:2009

    Stack trace:

    #0 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php(1835): WC_Payments_API_Client->check_response_for_errors(Array)

    #1 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php(1265): WC_Payments_API_Client->request(Array, ‘payment_methods…’, ‘GET’)

    #2 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/payment-methods/class-upe-payment-gateway.php(1070): WC_Payments_API_Client->get_payment_method(”)

    #3 /home4/kd65745/public_html/wp-includes/class-wp-hook.php(310): WCPay\Payment_Methods\UPE_Payment_Gateway->set_payment_method_title_for_email(Object(Automattic\WooCommerce\Admin\Overrides\Order), false, false)

    #4 /hom

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hi @teevee98

    Thank you for reaching out!

    The error message you’re seeing suggests that there’s an issue with accessing a specific resource in the WooCommerce Payments plugin.

    The error message Uncaught WCPay\Exceptions\API_Exception: Error: Sorry, you cannot access this resource suggests that the API client is trying to access a resource or perform an operation that it doesn’t have the necessary permissions for.

    The stack trace (the list of method calls at the time of the error) suggests that the error occurred when trying to get a payment method. This could be due to a variety of reasons such as connectivity issues, or restrictions placed on the account by the payment processor.

    Can you see if deactivating and then reactivating WooCommerce Payments makes any difference?

    If not, please can you share a copy of the following:

    • System Status Report: navigate to WooCommerce → Status. Select Get system report and then Copy for support.
    • Fatal Error log: Share a copy of any fatal error log found under WooCommerce → Status → Logs.

    Once you have these, please share them in your response here.

    Cheers!

    Thread Starter teevee98

    (@teevee98)

    Dear @beautyofcode

    thank you for the reply, when I deactivate the “WooCommerce Payments“, then im able to manually push the invoice with any errors [as I wanted to do in the first place].

    How do I best resolve this? [Should I delete the plugin and re-install?]

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hello @teevee98

    Thank you for reaching out to us. We appreciate your patience and are eager to help you with your concerns.

    The error is indicating that the system is trying to access a resource that it doesn’t have permission to access. Before proceeding with deleting and reinstalling the plugin, which can be a bit cumbersome, I would recommend a few troubleshooting steps:

    API Key: The API key used for WooCommerce Payments might be incorrect or doesn’t have the necessary permissions. Please check that the API key is correctly entered and has the correct permissions.

    Check for plugin conflicts: Sometimes, other plugins can interfere with the functionality of WooCommerce Payments. Try deactivating other plugins one-by-one to see if the problem persists. If the issue resolves, then the last plugin you deactivated is likely the culprit.

    Ensure WooCommerce and WooCommerce Payments are up to date: Make sure you’re running the latest versions of both WooCommerce and the WooCommerce Payments plugin. Updates often contain bug fixes and improvements that can resolve issues.

    Server Permissions: Your server might not have the required permissions to access certain files or directories. You can contact your hosting provider to ensure that the necessary permissions are in place.

    Review error logs: WooCommerce has a system status report that can provide more details about what might be causing the issue. You can find this under WooCommerce > Status > Logs.

    If none of the above steps work, then you may consider uninstalling and reinstalling the WooCommerce Payments plugin. Remember to backup your site before doing this to prevent any potential data loss.

    Please try these steps and let us know the results. We’re here to help you through this process and ensure your WooCommerce store operates smoothly.

    Thanks!

    Thread Starter teevee98

    (@teevee98)

    Dear @shameemreza

    Thank you for the suggestions.

    API Key – I need to find out how to do that.

    Check for plugin conflicts – I tried one-by-one, issue remain and only deactivate “WooCommerce Payments“ seems to resolve issue.

    Ensure WooCommerce and WooCommerce Payments are up to date – All up-to-date.

    Server Permissions – Not sure what I should ask my host in this regard

    Review error logs:

    2023-07-11T06:37:43+00:00

    CRITICAL Uncaught WCPay\Exceptions\API_Exception: Error: Sorry, you cannot access this resource. in /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php:2009
    Stack trace:

    0 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php(1835): WC_Payments_API_Client->check_response_for_errors(Array)

    1 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php(1265): WC_Payments_API_Client->request(Array, ‘payment_methods…’, ‘GET’)

    2 /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/payment-methods/class-upe-payment-gateway.php(1070): WC_Payments_API_Client->get_payment_method(”)

    3 /home4/kd65745/public_html/wp-includes/class-wp-hook.php(310): WCPay\Payment_Methods\UPE_Payment_Gateway->set_payment_method_title_for_email(Object(Automattic\WooCommerce\Admin\Overrides\Order), false, false)

    4 /hom in /home4/kd65745/public_html/wp-content/plugins/woocommerce-payments/includes/wc-payment-api/class-wc-payments-api-client.php on line 2009

    ———

    There were mention in the wordpress email that providing this can help too:

    WordPress version 6.2.2

    Active theme: OceanWP (version 3.4.6)

    Current plugin: WooCommerce Payments (version 6.1.1) PHP version 7.4.33

    Saif

    (@babylon1999)

    Hello @teevee98,

    thank you for the reply, when I deactivate the “WooCommerce Payments“, then im able to manually push the invoice with any errors [as I wanted to do in the first place].

    Just want to confirm this part, how exactly are you pushing the invoice?

    I’m asking because the mentioned template has protected functions, so if a third party invoicing plugin is involved, the error start to make sense.

    Protected functions are designed to be accessed within the class or its subclasses only. You can think of them as private pieces of code.

    Could you also attach a copy of your site’s System Status report? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support” (after you scroll down a bit)”. Once done, please paste it here in your reply or via a text-sharing service like https://gist.github.com/.


    Look forward to hearing back from you.

    Thread Starter teevee98

    (@teevee98)

    I downgraded to Version 6.0.0 and now all is working normal again.

    It seems like 6.1.1 is not stable.

    Plugin Support Sean O))) a11n

    (@seanomattic)

    Hi @teevee98,

    I downgraded to Version 6.0.0 and now all is working normal again.
    It seems like 6.1.1 is not stable.

    That doesn’t sound right, I suggest going to https://woocommerce.com/my-account/create-a-ticket/ and creating a ticket.

    Please supply your System Status Report and reference this thread in your message.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘E_ERROR was caused in line 2009’ is closed to new replies.