* Move no-shipping-placeholder to block - allow pointer events
* Allow payments placeholder to have pointer events
* Enable pointer events for children
* Wrap checkout with disabled
* remove usage of paymentstatus dispatcher from apple pay
* add type-def for payment data response objects
* make sure shape of payment data for stripe cc is as server expects
* include payment data in checkout processor request
* fix bug that got reintroduced in rebase
* rename typedef
* Add interface for setting an express payment error notice.
* fix typedefs
* remove usage of paymentstatus dispatcher from stripe cc
* remove usage of paymentstatus dispatcher from apple pay
* remove any existing express payment notice on click
* revert buggy change with abort payment call
- also ensure that completePayment sets applePayProcessing to false
* Switch add to cart events to useStoreCart hook
* Add to cart endpoint
* Inject dependenct schemas
* Feedback, cart items are based on product schema
* Variable typo
* Move hook to base
* Update totals correcrly
* Update tests to use schema/routes class
* Update tests to correctly use schema
* Remove type hint to prevent strict standards error
* Allow for priority to be set on event emitters
* Add payment event emitters
* add new actions/status to checkout state context
* implement event emitters in payment data context
* refactor checkout state context to use new actions in event emitters
* refactor checkout processor to handle new event emitters
* fix type-defs for registered payment methods
* register observer for cheque payment method integration
* add inline todo
* fix sort
* fix tests and add test for priority usage in event emitters
* remove todo and just add explanatory comment
* condense sort logic
* lowercase test description
* abstract emitter callback to reduce code
* don’t process passed in errors if it’s undefined
* improve error response expectation for payment processing event observer
* Added cheque gateway and payment method registration system
Fix promises
Remove log
Use status, not checkoutstate
Bug @nerrad showed me
Payment method type registry
Refactor integrations to register themselves.
Stripe and Cheque Integrations/registration
Splt gateways into separate files on build
Add settings from server to cheque gateway
Merge apple and credit card stripe scripts
* Missing files from rebase
* Tweaks to payment-methods-registry (https://github.com/woocommerce/woocommerce-blocks/pull/2091)
* Small tweaks and docblock updates
* Handle undefined settings
* rebase fix
* Simplify promise
* Remove filesuffix for payment methods config
* Fix typo
* Rebase fix
* Update cart and block actions
* Add woocommerce_blocks_payment_method_type_registration
* Missing method names
* Missing name in stripe
* replace actions with script dependencies
* Scripts are needed in admin context too, by default
* Put back the hooks...
* Add is_active check to see if assets need to be enqueued or not
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Hook up checkout validation with context
* Make sure hasValidationErrors is up to date in onCheckoutProcessing
* Move validation check inside CheckoutProcessor's processCheckout
* Make sure all checkout form fields have a unique ID
* Don't clear checkout context errors in shipping context
* Move CheckoutProcessor to the top so scrollToTop works
* Do not disable Place Order Button if there are errors
* Split checkValidation and processCheckout in Checkout Provider
* Refactor event emitter to use Maps
* Save payment method errors to validation context
* Show an notice when a payment method has an error
* Make sure JS errors during payment are displayed
* Remove error notice when payment method doesn't return an error anymore
* Make sure payment methods know if shipping and billing addresses are the same
* Make sure checkout is only processed if payment methods didn't fail
* Make sure state input also has an id
* Clear input and select errors on unmount
* Pass id to CountryInput and StateInput
* Fix function name
* Add missing default context values
* Move onCheckoutCompleteError effect to CheckoutBlock
* Remove conditional from shipping setHasError
* Rename and move existing checkout provider to checkout-state provider.
This allows us to re-use the interface exposed on this provider for cart and checkout blocks.
* refactor checkout provider to implement the new checkout state provider.
* Add Cart provider and export
* fix type-defs
* fix editor context provider and ensure all `isEditor` checks come from this provider
* fix type definition
* implement cart provider
* add selecting rate resolution state to the cart store
* expose whether rate is being selected on useSelectShippingRate
* Cleanup and refactor ShippingDataProvider
- remove un-needed component and move shipping rates into context provider
- remove error handling (currently the ui/ux for the checkout should result in no errors and any api errors are non-recoverable).
- Add logic for shipping rate selection into context provider and add event emitters for it.
- increment/decrement checkout calculation counts when shipping rates are being selected.
* dispatch checkout error if there is an error
* disable place order button if checkout is calculating or has error
* update doc block
* fix convention for js comment blocks
* add method for enqueueing editor assets for the block editor
* configure Checkout to ensure editor assets are loaded in the block editor.
* move common functions to abstract
* ensure cart has server data passed through to editor
* ensure `enqueue_data` is only ever called once.
* make sure we enqueue data for cart
* add missing attributes arg
* remove logic that doesn’t do anything
* add extra checks to checkout/cart/order APIs to avoid editor errors
* remove redundant register_block_script, introduced in rebase of woocommerce/woocommerce-blocks#2071
* prevent JS errors in checkout block in editor:
- add fallback state in defaults
- this is needed because checkoutData setting is null in admin
* Revert "add extra checks to checkout/cart/order APIs to avoid editor errors"
This reverts commit a26045b4a4675eb90b6b7235e2df0d29ca776915.
* Revert "prevent JS errors in checkout block in editor:"
This reverts commit 79729617f17c855ad71938af7703119fa5ccdabf.
* Hydrate from API conditonally
Co-authored-by: Mike Jolley <mike.jolley@me.com>