Same problem here … lin 161 – class-wc-sumup-block-gateway.php :
Warning: Undefined array key “enable_pix”
Same problem for me… 10 error messages on my shop :/
Thread Starter
Paul
(@headwall)
If you edit includes/class-wc-sumup-block-gateway.php and add the following snippet before the call to wp_localize_script(), it will get rid of the warnings safely:
if (!array_key_exists('enable_pix', $this->settings)) {
$this->settings['enable_pix'] = false;
}
if (!array_key_exists('open_payment_modal', $this->settings)) {
$this->settings['open_payment_modal'] = false;
}
I’ve run this patch on three sites now and the logs are clean again. It will do for now, until the author releases an update.
Thanks for your reply… I tried this and it’s worse!
Parse error: syntax error, unexpected token “}” in /homepages/45/d901075961/htdocs/wp-content/plugins/sumup-payment-gateway-for-woocommerce/includes/class-wc-sumup-block-gateway.php on line 143
Notice: La fonction is_embed a été appelée de façon incorrecte. Les balises de requête conditionnelle ne fonctionnent pas avant le lancement de la requête. Avant cela, elles renvoient toujours le booléen false. Veuillez lire Débogage dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version 3.1.0.) in /homepages/45/d901075961/htdocs/wp-includes/functions.php on line 5865
Notice: La fonction is_search a été appelée de façon incorrecte. Les balises de requête conditionnelle ne fonctionnent pas avant le lancement de la requête. Avant cela, elles renvoient toujours le booléen false. Veuillez lire Débogage dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version 3.1.0.) in /homepages/45/d901075961/htdocs/wp-includes/functions.php on line 5865
Il y a eu une erreur critique sur ce site.
Thread Starter
Paul
(@headwall)
@cariboulette Check that you have pasted the code correctly. Here is the code snippet with a bit more context (between START and END)
/**
* Translators: the following error messages are shown to the end user
*/
$error_general = __('Transaction was unsuccessful. Please check the minimum amount or use another valid card.', 'sumup-payment-gateway-for-woocommerce');
$error_invalid_form = __('Fill in all required details.', 'sumup-payment-gateway-for-woocommerce');
// START fix log warnings --------------------------------
if (!array_key_exists('enable_pix', $this->settings)) {
$this->settings['enable_pix'] = false;
}
if (!array_key_exists('open_payment_modal', $this->settings)) {
$this->settings['open_payment_modal'] = false;
}
// END fix log warnings ----------------------------------
wp_localize_script('wc-sumup-blocks-integration', 'sumup_gateway_params', [
'showInstallments' => "$show_installments",
'sumup_handler_url' => add_query_arg(
[
'wc-api' => 'sumup_api_handler',
'action' => 'create_checkout'
],
home_url() . '/'
),
'showZipCode' => "$show_zipcode",
'maxInstallments' => $number_of_installments,
'locale' => "$card_locale",
'country' => '',
'status' => '',
'errors' => [
'general_error' => "$error_general",
'invalid_form' => "$error_invalid_form",
'payment_error' => ''
],
'enablePix' => $this->settings['enable_pix'],
'openPaymentInModal' => $this->settings['open_payment_modal'],
'redirectUrl' => ''
]);
I hope this helps
-
This reply was modified 2 years ago by
Paul.
-
This reply was modified 2 years ago by
Paul.
Thank you so much!!! the 10 messages have disappeared!
I also have this problem for no reason, since the update that to bug the itnernet sites using Sumup I have an error Credentials are not valid. Please check and try again. I have redone the API Auth but nothing changes impossible to make it work, if the osuci is not solved knowing that I have not touched anything I leave Sumup and I take another solution for collections…….. =(