• Resolved Daniel Chase

    (@riseofweb)


    I am just looking at my error debug log and found this error related to the plugin.

    [06-Sep-2023 00:31:42 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_payment_method() on null in xx/public_html/wp-content/plugins/godaddy-payments/src/Gateways/PayInPersonGateway.php:143
    Stack trace:
    #0 xx/public_html/wp-includes/class-wp-hook.php(310): GoDaddy\WooCommerce\Poynt\Gateways\PayInPersonGateway->maybe_render_held_order_received_text('Thank you. We h...', NULL)
    #1 xx/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('Thank you. We h...', Array)
    #2 xx/public_html/wp-content/themes/classter/woocommerce/checkout/thankyou.php(100): apply_filters('woocommerce_tha...', 'Thank you. We h...', NULL)
    #3 xx/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/customer/...')
    #4 xx/public_html/wp-content/plugins/woocommerce/ in xx/public_html/wp-content/plugins/godaddy-payments/src/Gateways/PayInPersonGateway.php on line 143

    I have been using it for over a week and the plugin has been functioning normally – or so I thought.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support amberskyverge

    (@amberskyverge)

    Hey there,

    Amber here, thanks for contacting SkyVerge about our GoDaddy Payments for WooCommerce plugin! We’re currently experiencing a very high volume of support requests, so I apologize for the delay in getting back to you. I’m happy to help out. ??

    I understand that you noticed in your debug logs that there are PHP fatal errors happening in regards to the GoDaddy Payments for WooCommerce plugin that you just started using over a week ago. My apologies to hear that this is happening, let’s dive in.

    I would first like to better understand why this might be happening.

    What PHP version are you currently using on your website?
    Also, is this error still occurring over the last few days since you’ve reached out to us?

    All the best,

    Amber

    Thread Starter Daniel Chase

    (@riseofweb)

    My website uses PHP version 7.4.33.

    I have not seen any other errors related to the plugin since.

    Plugin Support Kari-SkyVerge

    (@kariskyverge)

    Hey @riseofweb,

    Thanks for the additional information. The error you are seeing there is related to the Pay In Person option for the GoDaddy Payments gateway. It is possible you might see this error come up if in your GoDaddy Payments account you have activated Pay In Person option and the GoDaddy Payments > Selling in Person option in WooCommerce is listed as a payment gateway option. It is also interesting that it seems like an “in passing” critical error, and not one that is persisting (thankfully!).

    Did you set up the Pay in Person options in your GoDaddy Payments account, and/or do you see the Selling in Person option on your website under WooCommerce > Settings > Payments, whether enabled or disabled?

    Best,

    Kari | Merchant Success Team

    Thread Starter Daniel Chase

    (@riseofweb)

    Thank you, Kari.

    I do see “GoDaddy Payments – Selling in Person – Pay in Person” as an option in the WooCommerce settings. But I have NEVER enabled it.

    I don’t know about the Pay In Person setting in my GoDaddy Payments account, but it could be possible that it is enabled. However it is not something I remember enabling or nor do I need it.

    The error is now reappearing again.

    [13-Sep-2023 06:11:51 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_payment_method() on null in xyz/public_html/wp-content/plugins/godaddy-payments/src/Gateways/PayInPersonGateway.php:143
    Stack trace:
    #0 xyz/public_html/wp-includes/class-wp-hook.php(310): GoDaddy\WooCommerce\Poynt\Gateways\PayInPersonGateway->maybe_render_held_order_received_text('Thank you. We h...', NULL)
    #1 xyz/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('Thank you. We h...', Array)
    #2 xyz/public_html/wp-content/themes/classter/woocommerce/checkout/thankyou.php(100): apply_filters('woocommerce_tha...', 'Thank you. We h...', NULL)
    #3 xyz/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/customer/...')
    #4 xyz/public_html/wp-content/plugins/woocommerce/ in /home/customer/www/americanlaserstudyclub.org/public_html/wp-content/plugins/godaddy-payments/src/Gateways/PayInPersonGateway.php on line 143
    Plugin Support Kari-SkyVerge

    (@kariskyverge)

    Hi Daniel,

    Thanks for the additional information here. I am sorry to hear that the error has come back.

    In looking at the entire stack trace you provided, in the #2 line it looks like the Thank You page may be getting modified by your theme, Classter. Since this is a premium theme, I am unable to download and install it on my local test site in order to see what is on “line 100,” where that call to apply filters is being made in the code.

    What I can see is that the “comment” above line 143 in one of the files that is throwing the error says // only show if the user checkout using pay in person payment method. Since your Pay in Person gateway is not enabled, I am a bit unsure why it would even bring in this function in the first place.

    The trigger for the error (line #0) comes from this part of the code in the class-wp-hook.php file:

    /**
    * Determines whether the gateway is configured.
    * @since 1.3.1
    * @return bool
    */
    public function is_configured() : bool
    {
    return PoyntHelper::hasPoyntSmartTerminalActivated();
    }

    I am going to reach out to one of our support engineers to see if they would be able to give us a little more clarity on why that Pay In Person gateway looks to be seen as active despite you not enabling it. While I do that, we can also have you check out that gateway on your site a bit.

    If you go into the settings for that gateway (Click on Manage), is there any information there that looks to have been auto populated or are the fields that would be “required” still blank there?

    Thanks,

    Kari | Merchant Success Team

    Thread Starter Daniel Chase

    (@riseofweb)

    I also noticed that the toggle for “GoDaddy Payments – Selling in Person – Pay in Person” is greyed out, and I could not enable it even if I tried.

    All of these fields are filled on the GoDaddy Payments settings page (wp-admin/admin.php?page=wc-settings&tab=checkout&section=poynt_credit_card) with no notices or error messages. Payments have gone through, and it seems to work fine.

    In response to the error, here is line 100 from “thankyou.php”/public_html/wp-content/themes/classter/woocommerce/checkout/thankyou.php”. Nothing that could cause the issue here:

    <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. We have emailed you a receipt for this transaction.', 'woocommerce' ), null ); ?></p>
    Plugin Support Kari-SkyVerge

    (@kariskyverge)

    Hey Daniel,

    Thank you for that additional information and the code! I have passed that along to our support engineers for the plugin.

    When I spoke to one of them late last week, they suspect that since there is a “null” value in there, your theme template may not know how to handle that exactly, so they may need to investigate if that is something that needs to be handled differently on our end.

    To see if it is perhaps specific to your particular theme, and not an error that happens with all themes, would you happen to have a staging site where you could try to replicate all of your current settings and plugins and then set the theme to a default one such as Twenty Twenty-Two? Then give an order a try and let me know if the error comes up on the staging? If not, you could of course try this on your live site, too, however since things are working on your live site currently, I would not recommend that route (if it’s not broke, don’t fix it!).

    Would you please let me know if you are able to test on a staging site and if so, what the outcome ends up to be?

    Best,

    Kari | Merchant Success Team

    Thread Starter Daniel Chase

    (@riseofweb)

    I like the staging site idea, but this does not occur with all transactions. That seems like a lot of work creating a bunch of test orders.

    Another hint is that these errors do not correspond with completed orders. The timestamps of the errors are not even within 1 hour of a logged WooCommerce order.

    Perhaps in the plugin code, you could add a null check before calling get_payment_method().

    E.g. change line 143 from:

    if (Plugin::PAYINPERSON_GATEWAY_ID === $order->get_payment_method()) { //Line of error
    

    to

    if ($order && Plugin::PAYINPERSON_GATEWAY_ID === $order->get_payment_method()) {
    
    
    Plugin Support Kari-SkyVerge

    (@kariskyverge)

    Hey Daniel,

    Thanks for the additional information! It sounds like we are on a similar page with this, and that extra information you provided is on track with what we have discussed with support engineering.

    One of our support engineers’ last suggestion as a workaround was this:

    We could probably improve our handling to just bail if a?null?value is passed, but most likely they’ll need to replace that with the Order object in their template to prevent the error for now.

    So, while we take a look at better handling of that line on our end, you could try adding that code adjustment to your theme’s functions.php file (or better yet in a child theme, or with a Code Snippet plugin), and see if that stops those from randomly popping up.

    Would you please let me know if you give that a try and the outcome if you do, as I pass your additional info here on to the support engineers to see what they think about that?

    Regards,

    Kari | Merchant Success Team

    Plugin Support Kari-SkyVerge

    (@kariskyverge)

    Hi Daniel,

    It has been a week since we heard from you, so I’m going to mark this topic as resolved.

    If you find you’re experiencing any transactional issues with GoDaddy Payments moving forward from this issue, please take a look at our FAQs for more information and create a new thread if you have further questions.

    Thanks,
    Kari | Merchant Success Team : )

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal error: Uncaught Error: Call to a member function get_payment_method() on n’ is closed to new replies.