checkout / checkout-woocommerce-plugin

Checkout.com plugin for WooCommerce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ApplePay 422 Error

Updula opened this issue · comments

Hi, we're getting this error in the latest 4.1.6.

The endpoint did not accept the request. (Code: 422)

Note that in 4.1.0 ApplePay works fine.

I checked channels settings and app webhooks are selected.

Update: looks like an SDK error: checkout/checkout-sdk-php#44

Please note we do not offer any shipping, perhaps that's the cause? missing shipping data?

When I disable debug settings > gateway responses, order is set to authorized without any transactions ref / capture.

After some debugging seem that main issue is token_invalid in the gateway response.

We found out issue is in class-wc-checkoutcom-api-request.php - removing sanitize_text_field from $apple_token = sanitize_text_field($_POST['token']); fixed the issue.