diff --git a/changelog/dev-10029-export-deposit-type-assert b/changelog/dev-10029-export-deposit-type-assert new file mode 100644 index 00000000000..684727000a7 --- /dev/null +++ b/changelog/dev-10029-export-deposit-type-assert @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Add type assertion for payouts CSV export response to ensure type safety and fix TypeScript linting error + + diff --git a/changelog/dev-10034-linter-warning-useeffect-unused-import b/changelog/dev-10034-linter-warning-useeffect-unused-import new file mode 100644 index 00000000000..4d2131a41b7 --- /dev/null +++ b/changelog/dev-10034-linter-warning-useeffect-unused-import @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Not user-facing: removed an unused `useEffect` import causing linter warnings + + diff --git a/changelog/fix-9942-no-cost-subscription b/changelog/fix-9942-no-cost-subscription new file mode 100644 index 00000000000..dc40262f302 --- /dev/null +++ b/changelog/fix-9942-no-cost-subscription @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Zero dollar subscriptions with zero dollar renewals checkout error diff --git a/client/checkout/blocks/index.js b/client/checkout/blocks/index.js index 3f98863d707..da139e3a27c 100644 --- a/client/checkout/blocks/index.js +++ b/client/checkout/blocks/index.js @@ -98,12 +98,13 @@ Object.entries( enabledPaymentMethodsConfig ) savedTokenComponent: , canMakePayment: ( cartData ) => { const billingCountry = cartData.billingAddress.country; + const needsPayment = cartData.cart.cartNeedsPayment; const isRestrictedInAnyCountry = !! upeConfig.countries.length; const isAvailableInTheCountry = ! isRestrictedInAnyCountry || upeConfig.countries.includes( billingCountry ); // We used to check if stripe was loaded with `getStripeForUPE`, but we can't guarantee it will be loaded synchronously. - return isAvailableInTheCountry; + return needsPayment && isAvailableInTheCountry; }, paymentMethodId: upeMethods[ upeName ], // see .wc-block-checkout__payment-method styles in blocks/style.scss diff --git a/client/components/woopay/save-user/checkout-page-save-user.js b/client/components/woopay/save-user/checkout-page-save-user.js index 45295c5c170..89c753cae7a 100644 --- a/client/components/woopay/save-user/checkout-page-save-user.js +++ b/client/components/woopay/save-user/checkout-page-save-user.js @@ -54,6 +54,13 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => { const { isWCPayChosen, isNewPaymentTokenChosen } = useSelectedPaymentMethod( isBlocksCheckout ); + + // In classic checkout the saved tokens are under WCPay, so we need to check if new token is selected or not, + // under WCPay. For blocks checkout considering isWCPayChosen is enough. + const isWCPayWithNewTokenChosen = isBlocksCheckout + ? isWCPayChosen + : isWCPayChosen && isNewPaymentTokenChosen; + const viewportWidth = window.document.documentElement.clientWidth; const viewportHeight = window.document.documentElement.clientHeight; @@ -193,7 +200,11 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => { return; } - if ( isSaveDetailsChecked && ! isPhoneValid ) { + if ( + isSaveDetailsChecked && + ! isPhoneValid && + isWCPayWithNewTokenChosen + ) { setValidationErrors( { [ errorId ]: { message: __( @@ -212,14 +223,9 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => { isSaveDetailsChecked, sendExtensionData, setValidationErrors, + isWCPayWithNewTokenChosen, ] ); - // In classic checkout the saved tokens are under WCPay, so we need to check if new token is selected or not, - // under WCPay. For blocks checkout considering isWCPayChosen is enough. - const isWCPayWithNewTokenChosen = isBlocksCheckout - ? isWCPayChosen - : isWCPayChosen && isNewPaymentTokenChosen; - const updatePhoneNumber = useCallback( () => { if ( isPhoneNumberTouched.current ) { return; diff --git a/client/overview/modal/progressive-onboarding-eligibility/index.tsx b/client/overview/modal/progressive-onboarding-eligibility/index.tsx index 6f6be89a707..21a6e5a22fa 100644 --- a/client/overview/modal/progressive-onboarding-eligibility/index.tsx +++ b/client/overview/modal/progressive-onboarding-eligibility/index.tsx @@ -1,7 +1,7 @@ /** * External dependencies */ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import { __, sprintf } from '@wordpress/i18n'; import { addQueryArgs } from '@wordpress/url'; import { Button, Modal } from '@wordpress/components';