Undefined index: wc-wc_checkout_com_cards-payment-token
-
Hi
I have setted up a sandbox environment. But during checkout I get an error “Undefined index: wc-wc_checkout_com_cards-payment-token”. In the sandbox, I got the public and secret keys, I also installed the webhook.
Also, when checking the webhook, on the Webhook tab, after ajax request I gor an emty response. After checking your code, I found that it does not pass the test validateSecretKey and validatePublicKey in file checkout-com-unified-payments-api/vendor/checkout/checkout-sdk-php/lib/Checkout/AbstractStaticKeysCheckoutSdkBuilder.php because test pattern is
“/^pk_(test_)?(\\w{8})-(\\w{4})-(\\w{4})-(\\w{4})-(\\w{12})$/” and a key is pk_sbox_xxxxxxxxxxxxxxxxxxxxxxxxxxx. How can it be? In your plugin you are using sdk package version 2.5.1 but last version is 3.0.2 and it has another pattern “/^pk_(sbox_)?[a-z2-7]{26}[a-z2-7*#$=]$/” wich should work. I have temporary disabled this check and try to run webhook check, but got an error “Webhook is not configured with the current site or there is some issue with connection, Please check logs or try again.”. I have checked the code again and found that it did not pass the condition is_registered in file checkout-com-unified-payments-api/includes/settings/class-wc-checkoutcom-webhook.php on line 232, the $this-get_list() function returned an empty array, and throws the CheckoutApiException without any data, only with 401 code, wich means unauthorized.
What am I doing wrong? Am I using the wrong version of the API? But I don’t see where to change it.
- The topic ‘Undefined index: wc-wc_checkout_com_cards-payment-token’ is closed to new replies.