buckaroo-it / WooCommerce

Repository containing the WooCommerce Payment Plugin by Buckaroo
2 stars 3 forks source link

BP-3646 Age verification using iDeal and iDIN throws null error (3.13.1) #273

Open Bl4ckace opened 3 months ago

Bl4ckace commented 3 months ago

My client installed the Buckaroo plugin 3.13.1 on his website and updated Woocommerce to 9.0.2. He wishes to use iDIN to verify the age of a customer through iDEAL.

For the eye: this setup seems to work as the iDIN logo is presented and the integration works with the customers keys and secrets.

Unfortunately, during checkout a 500 is thrown for a call to: ?wc-api=WC_Gateway_Buckaroo_idin-identify&issuer=BANKNL2Y

The following stacktrace is fished out of the console:

{
    "code": "internal_server_error",
    "message": "<p>Er heeft zich een kritieke fout voorgedaan op deze site.<\/p><p><a href=\"https:\/\/wordpress.org\/documentation\/article\/faq-troubleshooting\/\">Meer informatie over probleemoplossing in WordPress.<\/a><\/p>",
    "data": {
        "status": 500,
        "error": {
            "type": 1,
            "message": "Uncaught Error: Call to a member function get_failed_url() on null in \/home\/cabrio\/public_html\/wp-content\/plugins\/WooCommerce-3.13.1\/library\/common.php:537
Stack trace:
\/home\/cabrio\/public_html\/wp-content\/plugins\/WooCommerce-3.13.1\/controllers\/IdinController.php(74): fn_buckaroo_process_response(NULL, Object(BuckarooResponseDefault))\n#1 \/home\/cabrio\/public_html\/wp-includes\/class-wp-hook.php(324): 
IdinController->identify('')\n#2 \/home\/cabrio\/public_html\/wp-includes\/class-wp-hook.php(348): 
WP_Hook->apply_filters('', Array)\n#3 \/home\/cabrio\/public_html\/wp-includes\/plugin.php(517): 
WP_Hook->do_action(Array)\n#4 \/home\/cabrio\/public_html\/wp-content\/plugins\/woocommerce-legacy-rest-api\/includes\/class-wc-api.php(150): 
do_action('woocommerce_api...')\n#5 \/home\/cabrio\/public_html\/wp-includes\/class-wp-hook.php(324): 
WC_API->handle_api_requests(Object(WP))\n#6 \/home\/cabrio\/public_html\/wp-includes\/class-wp-hook.php(348): 
WP_Hook->apply_filters(NULL, Array)\n#7 \/home\/cabrio\/public_html\/wp-includes\/plugin.php(565): 
WP_Hook->do_action(Array)\n#8 \/home\/cabrio\/public_html\/wp-includes\/class-wp.php(418): do_action_ref_array('parse_request', Array)\n#9 \/home\/cabrio\/public_html\/wp-includes\/class-wp.php(813): 
WP->parse_request('')\n#10 \/home\/cabrio\/public_html\/wp-includes\/functions.php(1336): WP->main('')\n#11 \/home\/cabrio\/public_html\/wp-blog-header.php(16): wp()\n#12 \/home\/cabrio\/public_html\/index.php(17): require('\/home\/cabrio\/pu...')\n#13 {main}\n  thrown",
            "file": "\/home\/cabrio\/public_html\/wp-content\/plugins\/WooCommerce-3.13.1\/library\/common.php",
            "line": 537
        }
    },
    "additional_errors": []
}

I did some debugging and noticed that the function fn_buckaroo_process_response($1 = null, $2) has a variable that defaults to null, so the call to that method (which I could not directly find yet) seems to be incorrect.

Seeing the call is using /?wc-api instead of the new wp-json I also installed the Woocommerce Legacy API as additional plugin to re-enable this. But enabling or disabling this plugin (and thus enabling or disabling WC-API) seems not influence the outcome.

Buckaroo-Rene commented 2 months ago

Hi @Bl4ckace ,

Thank you for all the provided information. I have created a ticket for our development team to do some additional research regarding this issue. Will let you know when there is more information available or needed.

Best Regards, René