strangerstudios / pmpro-pay-by-check

Add a "Pay by Check" option to PMPro levels, and keep members in "pending" status until an admin changes the order status.
https://www.paidmembershipspro.com/add-ons/pmpro-pay-by-check-add-on/
11 stars 27 forks source link

Pay by Check + Advanced levels shortcode + Paypal Express raise pmpro_checkout_after_form error #119

Open PaulKempf opened 4 months ago

PaulKempf commented 4 months ago

Describe the bug Using Pay by check plugin with Paypal Express & Advanced levels shortcode, a fatal error is triggered on the Checkout page, after choosing a subscription level:

`Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class PMProGateway_paypalexpress does not have a method "pmpro_checkout_after_form" in /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php:324 Stack trace: #0 /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #1 /Applications/MAMP/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #2 /Applications/MAMP/htdocs/wp-content/plugins/paid-memberships-pro/pages/checkout.php(628): do_action('pmpro_checkout_...') #3 /Applications/MAMP/htdocs/wp-content/plugins/paid-memberships-pro/includes/page-templates.php(100): include('/Applications/M...') #4 /Applications/MAMP/htdocs/wp-content/plugins/paid-memberships-pro/includes/init.php(85): pmpro_loadTemplate('checkout', 'local', false) #5 /Applications/MAMP/htdocs/wp-includes/shortcodes.php(433): pmpro_pages_shortcode(Array, '', 'pmpro_checkout') #6 [internal function]: do_shortcode_tag(Array) #7 /Applications/MAMP/htdocs/wp-includes/shortcodes.php(273): preg_replace_callback('/\\[(\\[?)(pmpro_...', 'do_shortcode_ta...', '[pmpro_checkout...') #8 /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php(324): do_shortcode('[pmpro_checkout...') #9 /Applications/MAMP/htdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters('[pmpro_checkout...', Array) #10 /Applications/MAMP/htdocs/wp-includes/post-template.php(256): apply_filters('the_content', '[pmpro_checkout...') #11 /Applications/MAMP/htdocs/wp-content/themes/base-wp/inc/render/structure/page.php(46): the_content() #12 /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php(324): igthemes_page_content('') #13 /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #14 /Applications/MAMP/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #15 /Applications/MAMP/htdocs/wp-content/themes/base-wp/template-parts/content-page.php(17): do_action('igthemes_single...') #16 /Applications/MAMP/htdocs/wp-includes/template.php(812): require('/Applications/M...') #17 /Applications/MAMP/htdocs/wp-includes/template.php(745): load_template('/Applications/M...', false, Array) #18 /Applications/MAMP/htdocs/wp-includes/general-template.php(206): locate_template(Array, true, false, Array) #19 /Applications/MAMP/htdocs/wp-content/themes/base-wp/page.php(23): get_template_part('template-parts/...', 'page') #20 /Applications/MAMP/htdocs/wp-includes/template-loader.php(106): include('/Applications/M...') #21 /Applications/MAMP/htdocs/wp-blog-header.php(19): require_once('/Applications/M...') #22 /Applications/MAMP/htdocs/index.php(17): require('/Applications/M...') #23 {main} thrown in /Applications/MAMP/htdocs/wp-includes/class-wp-hook.php on line 324`

To Reproduce Steps to reproduce the behavior:

  1. Create an advanced level selector page on the subscription choice page
  2. Go to Subscription page
  3. Choose a subscription level (click on "Subscribe" or "Renew")
  4. On Checkout page, scroll down
  5. See error

Expected behavior No error should be displayed.

Isolating the problem (mark completed items with an [x]):

Additional information The pmpro_checkout_after_form doesn't seem to be defined in Paypal & Paypal Express classes, nor anywhere else. I'm not sure these should be called here, or at all?

WordPress Environment

``` WP core: 6.5.5 Paid Memberships Pro (Version 3.0.5) Paid Memberships Pro – Addon Packages (Version 0.7.8) Paid Memberships Pro – Advanced Levels Page Add On (Version 1.1) Paid Memberships Pro – Auto-Renewal Checkbox (Version 0.3.2) Paid Memberships Pro – Custom Level Cost Text Add On (Version 0.3.2) Paid Memberships Pro – Developer’s Toolkit Add On (Version 0.8.1) Paid Memberships Pro – Extra Expiration Warning Emails Add On (Version 1.0) Paid Memberships Pro – Pay by Check Add On (Version 0.7.8) Paid Memberships Pro – Reports Dashboard Add On (Version 0.3) Paid Memberships Pro – Signup Shortcode Add On (Version 0.3.3) Paid Memberships Pro – Subscription Delays Add On (Version 0.5.6) PMPro Customizations (Version 0.1) ```