vippsas / vipps-recurring-woocommerce

Vipps Recurring payments for WooCommerce
GNU Affero General Public License v3.0
6 stars 4 forks source link

Error on initialization #20

Closed o1ie closed 4 years ago

o1ie commented 4 years ago

Hi, getting the following error in sytem log when going to checkout with a subscription product and payment method falls back to another provider.

2020-09-07T11:04:52+00:00 CRITICAL Uncaught Error: Call to undefined function array_key_last() in /home/username/www/no/wp-content/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/class-wc-gateway-vipps-recurring.php:876
Stack trace:
#0 /home/username/www/no/wp-content/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/class-wc-gateway-vipps-recurring.php(847): WC_Gateway_Vipps_Recurring->capture_payment(Object(Automattic\WooCommerce\Admin\Overrides\Order))
#1 /home/username/www/no/wp-includes/class-wp-hook.php(289): WC_Gateway_Vipps_Recurring->maybe_capture_payment(21429)
#2 /home/username/www/no/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#3 /home/username/www/no/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#4 /home/username/www/no/wp-content/plugins/woocommerce/includes/class-wc-order.php(363): do_action('woocommerce_ord...', 21429, Object(Automattic\WooCommerce\Admin\Overrides\Order))
#5 /home/username/www/no/wp-con in /home/username/www/no/wp-content/plugins/vipps-recurring-payments-gateway-for-woocommerce/includes/class-wc-gateway-vipps-recurring.php on line 876
WC Version: 4.4.1
REST API Version: ✔ 1.0.15
WC Blocks Version: ✔ 3.1.0
Action Scheduler Version: ✔ 3.1.6
WC Admin Version: ✔ 1.4.0
Log Directory Writable: ✔
WP Version: 5.5.1
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: nb_NO
External object cache: –
Vipps faste betalinger for WooCommerce: av Everyday AS – 1.4.0
Betal med Vipps for WooCommerce: av WP Hosting – 1.4.11
Marcuzz commented 4 years ago

Hey,

Thanks for reporting this bug! It appears we were using a function which isn't available in PHP versions prior to 7.3.0. This was unintentional and we have published an update (1.4.1) which fixes this issue for you 😄

o1ie commented 4 years ago

Sweet @Marcuzz, thanks for the quick reply :)

o1ie commented 4 years ago

Not related, but would this be something that can be increased? Or truncated by the plugin?

2020-09-07T14:55:10+00:00 DEBUG 
==== Vipps Recurring Version: 1.4.1 ====
==== Start Log ====
[21439] Error in process_payment: initialCharge.description: size must be between 0 and 45
productName: size must be between 0 and 45
Marcuzz commented 4 years ago

@o1ie Yeah, unfortunately we can't increase it via the plugin, but we can truncate it.

Version 1.4.2 should have fixed this now

Edit: You'll have to wait for 1.4.3, I didn't have the opportunity to test it and it appears there are more fields with limits 😅

o1ie commented 4 years ago

Awesome @Marcuzz, appreciate the quick response 😄

Marcuzz commented 4 years ago

@o1ie There you go, 1.4.3 is out and I confirmed it's working this time 😎

o1ie commented 4 years ago

Great @Marcuzz, working like a charm 😄 Let me know if you want me to post a separate issue on this for the records.

Marcuzz commented 4 years ago

You're welcome 😀

And yeah, sure, a separate issue would be nice 🙂