pronamic / wp-pronamic-pay-give

Give driver for the WordPress payment processing library.
http://www.wp-pay.org/extensions/give/
3 stars 1 forks source link

Exception on Donation form page if Gateway Configuration does not exists #3

Closed knit-pay closed 3 years ago

knit-pay commented 3 years ago

Hello Team

Getting Exception on Donation form page if Gateway Configuration does not exist.

https://github.com/wp-pay-extensions/give/blob/b17758415a2d3ce00d677efcabcb16740d4d06c5/src/Gateway.php#L178:L181

[24-Sep-2021 07:55:59 UTC] PHP Fatal error:  Uncaught Error: Call to a member function set_payment_method() on null in /wp-content/plugins/pronamic-ideal/vendor/wp-pay-extensions/give/src/Gateway.php:181
Stack trace:
#0 /wp-content/plugins/pronamic-ideal/vendor/wp-pay-extensions/give/src/Gateway.php(225): Pronamic\WordPress\Pay\Extensions\Give\Gateway->input_fields(222)
#1 /wp-includes/class-wp-hook.php(305): Pronamic\WordPress\Pay\Extensions\Give\Gateway->payment_fields(222)
#2 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters('', Array)
#3 /wp-includes/plugin.php(470): WP_Hook->do_action(Array)
#4 /wp-content/plugins/give/includes/forms/template.php(291): do_action('give_pronamic_p...', 222, Array)
#5 /wp-includes/class-wp-hook.php(303): give_show_purchase_f in /wp-content/plugins/pronamic-ideal/vendor/wp-pay-extensions/give/src/Gateway.php on line 181
rvdsteege commented 3 years ago

Thank you, Gautam! Fixed in https://github.com/wp-pay-extensions/give/commit/d1a9ffe2938144d0e7ba6f8767316717a246c804 by removing payment methods without valid configuration from the checkout form.

knit-pay commented 3 years ago

Thanks for taking action.