* fix arguments
* only set payment status to pristine if it isn’t already successful
* add server side handling for saved tokens
* ensure correct gateway is selected when using saved card:
- reset the active payment method when user selects saved payment method
(card); this ensures that the correct gateway is used when switching
from another gateway to a saved card
* enhance radiocontrol to receive option specific change events.
* implement specific option change events
This commit:
- ensures selecting a saved payment option updates active payment method for the selected option.
- Sets the saved token key for the selected option correctly.
* remove unnecessary php side code
* fix bug with default saved payment option not applying:
When the payment options are initialised, we now call the onChange
handler for the default (`is_default`) option. This triggers payment
success() so checkout succeeds with default payment method, even if user
doesn't touch payment options.
* fix effect dependencies
Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
* add typedefs for store notice context
* improve useStoreNotices hook so returned interfaces are fairly constant
* fix dependencies, defaults, and add types
* fix dependencies
* fix dependencies
* improve functions exposed on validation context so they are more constant
* fixing dependencies
* normalize tokenId to string everywhere
Assuming the token is a number is a bad idea because it is feasible that source for some payment methods could be a string. Also when retrieved as an input value, the id will be a string anyways.
* refactor to move payment processing into it’s own effect
- this is the first step in trying to improve the createSource behaviour.
* memoize setValidationErrors so onPaymentProcessing event effect doesn’t re-run unnecessarily.
* Update assets/js/payment-method-extensions/payment-methods/stripe/credit-card/use-payment-processing.js
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* fix docs alignment
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
* Update notices to say `card` instead of `card's`
* Track isEmpty per field so placeholders are not visible when focusing and defocusing other fields
* Make payment notices non-dissmissable, and removed on payment method switch
* Don't add validation notices
* implement nullish coalescing operator
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Remove summary from API
* Add wordCountType to assets
* Update packages
* Remove summary from test data
* Featured product uses short desc
* Pass description instead of summary
* Use new Summary Component
* Component and tests
* Increased versititilty of methods
* Update assets/js/base/components/cart-checkout/product-summary/index.js
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Extra tests for html tags
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
* Remove unused shippingAsBilling prop from billing data context
* Move functions out of component and add docblocks
* Local address state
* Refactor into new custom hook
* Remove TODO and code fixed in core
* useShallowEqual to prevent updates on all field changes
* Fix stale validation errors
* cleanup
* Should be setting local state not global state for email and phone
* Combine useEffects and pass correct deps
* Update assets/js/base/hooks/checkout/use-checkout-address.js
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Prettier
* Move validation update check into updateValidationError
* Fix state updaters
* Fix context definition for setShippingAddress
* Fix validation updates
* errorId dep
* Reapply changes to checkout block
* Update equality checks
Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
* Use container queries to load Cart and Checkout responsive styles
* Update package-lock.json
* Make form-step react to container queries instead of media queries
* Make sidebar layout inner padding relative to the full-width
* Make container queries breakpoints smaller
* expose guest checkout related options to blocks
* don't show checkout if user is not logged in and guest checkout is disabled
* checkout block doesn't yet support signup:
- if logged out / guest, don't show checkout
- even if store allows sign up at checkout
* only show login prompt if user is not logged in
* link to login page (as needed) if checkout requires login
* rejig hide login link when necessary:
- use customerId from checkout context
- revert currentUserLoggedIn setting - not needed
* add redirect param to checkout login links (so checkout can continue)
* Switch all font-sizes to use the mixin
* Add notice in coding-guidelines to use accessible font sizes
* Fix label alignment in forms with big font-sizes
* Fix Stripe input boxes font-size not being responsive
* Fix select overflowing in small font sizes
* Add rem function from woocommerce/woocommerce-blocks#2320
* Make the font-size() mixin set relative line-height values
* Convert several magic numbers to use the new mixins
* Update docs
* Update input/select paddings to use the rem mixin
* Add lineHeight comment
* Interpolate rem() mixin inside calc
* Make input padding use only relative units
* Prevent SnackbarList from loading in the editor
* Fix snackbar styles leaking into the editor
* Prevent 'Proceed to Checkout' button being fixed to the bottom in the editor
- set appropriate padding for main cart container
- card padding is currently provided by Gutenberg component (?)
- overriding padding on totals card to match main container