-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkout mutation payload contains WooCommerce error HTML and breaks JSON #265
Comments
Okay it seems one particular payment gateway is issuing the alert. Have to do some further investigations. |
After further investigation it seems my gateway is making an API request upon order creation. It's using a custom meta orderId that at the time of the request is NULL. Does woocommerce-graphql first create/process the order and then add the meta fields? I suspect the custom meta value is not available when the request is made. Edit: After some digging it seems this is the case. @kidunot89 Are there ways of making sure meta values are added before the order is processed? WooCommerce own order creation api wrapper adds the meta values before processing the order and since switching to the WooCommerce-GraphQL checkout mutation it's not working anymore. |
@zamson here are the steps of the
If your gateway requires meta, you can use the Also note, that in release v0.5.1, the graphql_{$payment_method}_process_payment_args filter has been added. The |
I'm already supplying the meta values in the input of the checkout mutation. The payments processes without problem when testing with a WP theme in WP and same gateway. I've also made sure the values are present and the same as a normal WP order, so I'm still thinking the value is not there when my gateway receives the order. I'll make sure to checkout 0.5.1 and the filter. |
🤔 I'll have to look into the Klarna payment gateway. |
Btw, it says paymentMethod: cod in my screenshot, but this was just temporary. When testing it was set to "kco". |
After some more digging in the Klarna code I realised my mistake. I had |
Describe the bug
I've encountered a strange bug that only happens on one of my sites. When running the checkout mutation WooCommerce seems to output some errror HTML in payload and thus breaks the JSON formatting.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Order should be created in WooCommerce and response data should be given
Screenshots
![image-1](https://user-images.githubusercontent.com/11811478/80185316-bcb08200-863e-11ea-91b6-36aa98da7e1b.png)
The text was updated successfully, but these errors were encountered: