* Feature gate PaymentApi
* Improve payment method missing dependencies error message so it's clear it only affects blocks
* Add PaymentApi feature flags to list of feature flags in docs
* Replace filters with an extendibility API to hook into Cart and Checkout blocks
* Update docs
* Add a validate argument
* Add docs comments
* Add tests
* Add validation function
* Prefix validateElementOrString with __experimental
* Update experimental docs
* Typo
* Update comment
* Update JS docs
* Use an object for applyCheckoutFilter args
* Args doesn't need to be an object
* Wrap validation function execution in a try/catch block
* Only accept strings for the totalLabel filter
* Change applyCheckoutFilter signature
* Remove references to no-longer-existing isFeaturePluginBuild calls
This is because these were moved/removed in woocommerce/woocommerce-blocks#3065 but the docs were not updated fully.
* Update reference to travis to GitHub actions in docs
* Update JS testing doc to have info about Github Actions
* Add documentation for gateway_features_list hook
This was added in woocommerce/woocommerce-blocks#3719 but not documented.
* Honor hidden property of cart item data and add support for experimental property
* Add docs to experimental property
* Typo
* Add protection in ProductDetails for the case where 'details' is not an array
* Update ProductDetails so it works properly in cases where 'name' is not provided
* Add snapshot testing to ProductDetails
* Remove savePaymentInfo check when displaying payment methods
This is because the savePaymentInfo is derived from whether the save payment method checkbox shows. This check doesn't make sense to do because it's not a good indicator of whether the payment method is enabled. Subscriptions for example hides the checkbox because it is implied that the method will be saved. We should instead rely on the server-side to only send permitted saved payment methods.
* Add safely_get_request_payment_method
This will allow us to try to get the payment method if it was passed in the request, but will default to an empty string if not. This is different to get_request_payment_method because it doesn't throw any errors. We need it to be different because get_request_payment_method is used when the order definitely needs payment (so a normal checkout scenario, vs. a £0 subscription checkout)
* Add action to update order meta when checking out
This is needed because some extensions rely on this action to add their information to the metadata of order items.
* Remove safely_get_request_payment_method
This is no longer needed.
* Remove @since from experimental hook
* Add PHPDoc for new update_order_meta hook
* Document use of experimental hook
* Reinstate the check for allowing saved cards
* Add method to Stripe integration to determine if saved_cards is enabled
* Add new field to get_payment_method_data
This adds displaySavePaymentMethodCheckbox which will be used to determine if the checkbox to save payment methods should display.
* Add displaySavePaymentMethodCheckbox option to client
This will determine whether the "Save payment information" checkbox will be displayed.
* Add requiresSaving option to Stripe payment method data
This is informed by the saved_cards option and the result of the wc_stripe_display_save_payment_method_checkbox filter.
* Rename displaySavePaymentMethodCheckbox to requiresSaving & fix logic
* Revert negation on display_save_payment method_checkbox filter & rename
We are going to rename the properties we use to determine whether saved cards are shown, or whether the save payment method checkbox is shown, so that their names are more descriptive of what they are for.
* Rename allowSavedCards and requiresSaving in Stripe integration
* Rename savePaymentInfo&requiresSaving to showSavedCards & showSaveOption
This is so we can hide the checkbox independently of hiding the saved payment methods.
* Show deprecated message if payment methods use savePaymentInfo
This is because we are leaving it in to enable backward compatibility but payment methods registering using this should be informed of the change in case it gets removed.
* Update Stripe typedefs and keys of supports object
* Show customer payment methods if showSavedCards is true on the method
* Make PaymentMethodTab accept showSaveOption prop
This will allow us to show the save checkbox only if the payment method says it should be shown.
* Update tests to use new keys in supports when reg'ing payment methods
* Add optional chaining when validating payment method config
This makes the code a little tidier :)
* Update assets/js/blocks-registry/payment-methods/payment-method-config.js
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Add more information to deprecated call in payment method config
* Fix lint error
* Fix prop types for PaymentMethodTab
* Add information about supports on payment methods to docs
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Remove no longer used __experimentalPersistItemToCollection function
* Add __experimentalDeRegisterPaymentMethod and __experimentalDeRegisterExpressPaymentMethod to feature flags doc
* add doc for feature flag and experimental interfaces
* add new doc to TOC
* update pull request template to include checklist item for experimental/feature flag items
* tweak wording for experimental prefix
* fix bad formatting of bold for lines
* fix double slash in url
* add missing sentence case
* remove account signup as that is not included in Cart and Checkout block logic.
* Fix typo