woocommerce-blocks icon indicating copy to clipboard operation
woocommerce-blocks copied to clipboard

Checkout order and Order endpoints don't support extensions endpoint and aren't backward compatible.

Open senadir opened this issue 1 year ago • 1 comments

Recently introduced Checkout Order and Orders don't contain extensions fields and/or are not compatible with existing extensions.

Checkout order

  • This is a POST only endpoint that allows you pay for existing orders, it already has an extensions key (by inheriting the CheckoutSchema class) but the key is checkout-order instead of checkout. This means plugins relying on pushing data with checkout POST requests will not work as they're waiting at checkout key.

Orders

  • This is a GET endpoint that will return an array of Cart-shaped pending orders. It doesn't include an extensions key, so it can't be extended, and existing plugins that extend Cart can't append data to it, meaning it will surface missing information (for things like Subscriptions and such).

Expected solutions

  • Add an extensions key Orders endpoint.
  • Add backward compatibility to Checkout Orders endpoint so that it uses whatever is registered in checkout, but only if nothing is registered in checkout-order. This will probably require some tweaking from our ExtendSchema class.
  • Add the same backward compatibility for Orders endpoint so that it uses whatever is in Cart. Developers can opt out of this fallback method by registering an empty response to order or checkout-order.

senadir avatar Oct 10 '23 12:10 senadir

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

github-actions[bot] avatar Feb 12 '24 09:02 github-actions[bot]