Open crot4lus opened 2 months ago
As an aside to this, there is no obvious way for the end user to see we have a date field as it's located at the bottom of the checkout page. It also ignores the checkbox for Terms & Conditions.
The PayPal plugin does things differently, it allows you to choose Apple / Google Pay, authorise the payment then returns you to the checkout to complete any additional information and confirm your acceptance of the Terms.
A similar process for Stripe would be great.
There are a couple of challenges in supporting additional fields for Express Checkout (Apple Pay/Google Pay). I am listing them in order of complexity as I see it.
data
we are passing when creating the order. We are already doing this for shortcode checkout; we need to add support for blocks checkout.WC_Checkout::process_checkout()
function, which at the moment does not support additional fields.
WC_Checkout::process_checkout()
, or maybe consider shifting to Store API?
Describe the bug In our installation we've registered a checkout field in the block based checkout for a delivery date. This is created using the woocommerce_register_additional_checkout_field WooCommerce function. When checking out via Apple Pay on Stripe, I can see in the request params to /?wc-ajax=wc_stripe_create_order that the field is included:
additional_information-order-date: 2024-09-13
However this gets ignored, and doesn't get added as a meta field. On a standard checkout process this would be stored in the wp_wc_orders_meta table as _wc_other/order-date.
I have a fallback for normal orders where this might fail using the woocommerce_store_api_checkout_order_processed hook to set it to the first available delivery date if the request doesn't contain it, but this doesn't get used during the Stripe Apple Pay/Gpay process either.