Closed senadir closed 1 year ago
This issue only seems to happen if you have more than 1 payment method active, if COD is the only one enabled, enum
is an empty array and that skips checking all together?
cc @mikejolley
cc @ralucaStan I've marked this as cooldown so it can be picked up.
@senadir Gonna need you to come back and help replicate this one. I tested a few combinations here; multiple gateways active, various rules (require flat rate, require pickup). When COD was available on checkout my orders went through ok.
You're incorrect about it being stateless afaik. The enum uses get_available_payment_gateways
and this will refer to the current session to determine which gateways are available. So if you have a valid cart, and your session is up to date, the request to the server will succeed.
Can you take another look?
It seems the error only surfaces if Accept COD if the order is virtual
is off.
You're incorrect about it being stateless afaik. The enum uses get_available_payment_gateways and this will refer to the current session to determine which gateways are available. So if you have a valid cart, and your session is up to date, the request to the server will succeed.
This might not always use a session, hitting OPTIONS
endpoint will use session, this is where I found the COD
to be missing.
is Schema validation happening before session is loaded?
This came up in zendesk—I'll add it to my list to tackle before next release.
Recent PR https://github.com/woocommerce/woocommerce-blocks/pull/8441 changed how we define Checkout
payment_method
schema for enabled payment methods to available ones to checkout with.This caused an issue with conditional payment methods like Cash on Delivery which aren't available unless certain conditions are met like selected shipping method, which is only available with a session, but schema generation and validation is sessionless.
Steps to reproduce
payment_method isn't $other_payment_methods