angelleye / woo-paypal-here

Process WooCommerce Orders with PayPal Here
GNU General Public License v3.0
6 stars 2 forks source link

PHP Errors..?? #23

Closed angelleye closed 6 years ago

angelleye commented 6 years ago

This just started happening today for some reason while I was doing my demo with PayPal. In this case I'm trying to load pending orders.

Notice: Undefined property: Paypal_Here_Woocommerce_Rest_API::$woocommerce in /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-rest-api.php on line 74

Fatal error: Uncaught Error: Call to a member function get() on null in /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-rest-api.php:74 Stack trace: #0 /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-end-point.php(294): Paypal_Here_Woocommerce_Rest_API->angelleye_paypal_here_get_pending_order() #1 /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-end-point.php(285): Paypal_Here_Woocommerce_End_Point->angelleye_paypal_here_display_order_list() #2 /home/angelley/sandbox_woocommerce/wp-includes/class-wp-hook.php(286): Paypal_Here_Woocommerce_End_Point->angelleye_paypal_here_view_pending_orders_body_content('') #3 /home/angelley/sandbox_woocommerce/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #4 /home/angelley/sandbox_woocommerce/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/angelley/sandbox_woocommerce/wp in /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-rest-api.php on line 74

angelleye commented 6 years ago

@kcppdevelopers When I Revoke my keys from the plugin settings I end up with this PHP warning...

Warning: Cannot modify header information - headers already sent by (output started at /home/angelley/sandbox_woocommerce/wp-content/plugins/woo-paypal-here/includes/class-paypal-here-woocommerce-rest-api.php:42) in /home/angelley/sandbox_woocommerce/wp-admin/includes/misc.php on line 1116

angelleye commented 6 years ago

@kcppdevelopers Right now you have a wp admin notice with this verbiage...

Consumer key and Consumer secret not available

Let's change that to say...

Your API keys for WooCommerce are not configured. Please click the Generate WooCommerce REST API Key button in the PayPal Here settings to fix this.

Make the words PayPal Here settings a link to the settings page.

angelleye commented 6 years ago

@kcppdevelopers Also, we noticed that when we clicked the Generate button, I did not get any sort of a notice about whether or not it worked. When I refreshed the page, I did see the key was generated, but I was left confused when I first did it.

Not sure if this has something to do with the PHP notices that were being displayed blocking our notice from showing up, or if we didn't have a notice. One way or another we need to make sure to show the use that the key was successfully generated.