Commit Graph

20 Commits

Author SHA1 Message Date
Thomas Roberts abfa36634c Graduate `__experimental_woocommerce_blocks_checkout_update_order_meta` action to stable (https://github.com/woocommerce/woocommerce-blocks/pull/5017)
* Deprecate __experimental_woocommerce_blocks_checkout_update_order_meta

* Update docs to show new action and remove deprecated one

* Amend deprecated tag and add version numbers

* Resolve conflict where old hook name was included in example docs
2021-11-02 10:15:12 +00:00
Thomas Roberts b0795c8502 Graduate `__experimental_woocommerce_blocks_checkout_update_order_from_request` action to stable (https://github.com/woocommerce/woocommerce-blocks/pull/5015)
* Deprecate __experimental_woocommerce_blocks_checkout_update_order_from_request

* Update docs to show new action and remove deprecated one

* Ensure correct args are passed to deprecated hook and update message

* Amend deprecated tag and add version numbers

* Remove incorrectly updated file from this PR
2021-11-02 09:21:51 +00:00
Thomas Roberts 12045c731a Graduate `__experimental_woocommerce_blocks_checkout_order_processed` action to stable (https://github.com/woocommerce/woocommerce-blocks/pull/5014)
* Deprecate __experimental_woocommerce_blocks_checkout_order_processed

* Update docs to reflect new hook name

I also mentioned this hook is deprecated in the experimental interfaces doc.

* Update deprecated tag in docblock

* Fix typo in deprecated docblock

* Send args to do_action_deprecated in an array

* Amend deprecated tag and add version numbers
2021-11-02 08:46:54 +00:00
Raluca Stan 05dc130d21 Register as experimental the Cart i2 blocks and update the feature flag documentation (https://github.com/woocommerce/woocommerce-blocks/pull/4936)
* Use registerExperimentalBlockType for registering Cart i2 related blocks

* Update feature flags and experimental interfaces doc
2021-10-14 13:44:46 +01:00
Seghir Nadir 686bb662ad Update feature flags and experimental interfaces document. (https://github.com/woocommerce/woocommerce-blocks/pull/4750)
* add missing blocks and update old links

* features behind a feature flag

* update filters and JS methods

* Apply suggestions from code review

Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
2021-09-16 14:50:33 -04:00
Raluca Stan 615b939383 Add Typescript to /blocks-registry/payment-methods (https://github.com/woocommerce/woocommerce-blocks/pull/4702)
* Type payment method under /block-registry

* Type assertions and add them back to PaymentMethodConfig

* Type ExpressPaymentMethodConfig

* Fix comment on payments types

* Fix CanMakePayment type

* Fix assertion for payment methods and the savedTokenComponent property

Because class properties come from the config object, they will never be null except if somebody explicitly adds them the the object with a value of null.
Which is not the case for savedTokenComponent for example, because it's optional and that's why we check it like this paymentMethods[ activePaymentMethod ]?.savedTokenComponent

* Add the complete CanMakePaymentReturnType and account for null for PaymentMethod.icons

- canMakePayment can also return a Promise and this was not included in the type definition
- in PaymentMethodConfig's constructor we also need to account for extensions passing {icons: null}.

* Revert Fix assertion for payment methods and the savedTokenComponent property

* Fix failing tests because of savedTokenComponent

I've reverted my changes and left the initialization of savedTokenComponent as it was.

* Rename types for more clarity

* Fix ExtensionNamespace and PaymentMethodName types

* Rename Supports and *PaymentMethodOptions type for better clarity
2021-09-15 18:36:02 +02:00
Mike Jolley 581769886a Update checkout route hooks to support extensions (https://github.com/woocommerce/woocommerce-blocks/pull/4610)
* Remove account creation gating

* Unneccessary use statements

* Tidy up with null coalescing operators

* Add __experimental_woocommerce_blocks_checkout_update_order_from_request action

* Default to 200 status

* add docs in feature flag file

* align docs with hook

Co-authored-by: Nadir Seghir <nadir.seghir@gmail.com>
2021-08-25 11:29:45 +01:00
Thomas Roberts 0edcd0ef9a Add documentation for __experimentalDiscountsMeta slot (https://github.com/woocommerce/woocommerce-blocks/pull/4349) 2021-06-15 09:30:13 +01:00
Albert Juhé Lluveras a25eba0232 Feature gate PaymentApi (https://github.com/woocommerce/woocommerce-blocks/pull/4176)
* 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
2021-05-10 10:00:14 +02:00
Mike Jolley 8f78528245 Enable Google Analytics Integration (https://github.com/woocommerce/woocommerce-blocks/pull/4020)
* Remove experimental flag

* Add experimental docs
2021-04-06 12:59:31 +01:00
Albert Juhé Lluveras 9e5b5041b8 Update experimental flags documentation (https://github.com/woocommerce/woocommerce-blocks/pull/4017) 2021-04-01 11:34:09 +02:00
Albert Juhé Lluveras 1a97bf80b0 Replace filters with an extendibility API to hook into Cart and Checkout blocks (https://github.com/woocommerce/woocommerce-blocks/pull/3774)
* 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
2021-02-09 17:54:38 +01:00
Thomas Roberts 0f75325fd0 Add new links to experimental docs and update JS testing docs (https://github.com/woocommerce/woocommerce-blocks/pull/3785)
* 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.
2021-02-05 09:11:05 +00:00
Albert Juhé Lluveras 4ae28daca0 Honor hidden property of cart item data and add support for experimenal property (https://github.com/woocommerce/woocommerce-blocks/pull/3732)
* 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
2021-01-26 15:50:19 +01:00
Thomas Roberts 96e3ff9662 Change payment processing for subscriptions (https://github.com/woocommerce/woocommerce-blocks/pull/3686)
* 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>
2021-01-24 14:59:13 +01:00
Albert Juhé Lluveras 03b03380d3 Allow extensions to filter Total label (https://github.com/woocommerce/woocommerce-blocks/pull/3716)
* Allow extensions to filter totals label

* Add docs
2021-01-21 15:45:31 +01:00
Albert Juhé Lluveras 8d9d98d8e9 Add missing experimental functions to the feature flags page (https://github.com/woocommerce/woocommerce-blocks/pull/3522)
* Remove no longer used __experimentalPersistItemToCollection function

* Add __experimentalDeRegisterPaymentMethod and __experimentalDeRegisterExpressPaymentMethod to feature flags doc
2020-12-09 15:10:57 +01:00
Albert Juhé Lluveras 85e3e8df2f Add missing experimental hook to docs (https://github.com/woocommerce/woocommerce-blocks/pull/3508) 2020-12-07 11:46:22 +00:00
Darren Ethier 64210fab1b Add new doc referencing feature flags and experimental interfaces. (https://github.com/woocommerce/woocommerce-blocks/pull/3348)
* 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
2020-10-30 10:35:50 -04:00
Mike Jolley 340cf01255 Update documentation indexes and add checkout docs (https://github.com/woocommerce/woocommerce-blocks/pull/2720)
* Fix existing indexes

* Update indexes

* Stock docs
2020-06-16 16:50:09 +01:00