Skip to content

Commit

Permalink
Merge branch 'develop' into update/9764-remove-browser-export
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagesh Pai committed Dec 24, 2024
2 parents 0ba8731 + 21d5cf8 commit 87ad001
Show file tree
Hide file tree
Showing 143 changed files with 2,115 additions and 529 deletions.
4 changes: 4 additions & 0 deletions changelog/add-9973-enable-pms-from-capabilities
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Enable Payment Methods preselected by NOX after onboarding accounts
5 changes: 5 additions & 0 deletions changelog/add-beta-badge-woopay-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: add
Comment: Adds a label to a gated feature.


4 changes: 4 additions & 0 deletions changelog/add-woopay-klaviyo-newsletter-support
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: add

Add WooPay Klaviyo newsletter integration.
5 changes: 5 additions & 0 deletions changelog/dev-10029-export-deposit-type-assert
Original file line number Diff line number Diff line change
@@ -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


5 changes: 5 additions & 0 deletions changelog/dev-10034-linter-warning-useeffect-unused-import
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Not user-facing: removed an unused `useEffect` import causing linter warnings


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Remove hooks from customer and token services to dedicated methods
4 changes: 4 additions & 0 deletions changelog/feat-9810-add-seller-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Add seller_message to failed order notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Add type assertion for disputes CSV export response to ensure type safety and fix TypeScript error
5 changes: 5 additions & 0 deletions changelog/fix-198-mccy-fedex-conversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Fix FedEx insurance rates with different currencies.


Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Apply User-Defined Date Formatting Settings to WP Admin React Components
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Use translatable strings on the fee breakdown tooltip of the payment settings screen.
4 changes: 4 additions & 0 deletions changelog/fix-9114-level3-rounding
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Add a rounding entry to Level 3 data for rare cases where rounding errors break calculations.
4 changes: 4 additions & 0 deletions changelog/fix-9303-upgrade-woocommerce-csv-export-package
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Upgrade `@woocommerce/csv-export` package to v1.10.0 – fixes unnecessary escaping of negative values in CSV exports that was preventing numerical analysis in spreadsheet applications
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Hide transaction fee on admin view order screen when transaction is not captured.
4 changes: 4 additions & 0 deletions changelog/fix-9735-render-transactions-correctly-on-capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Ensure captured transactions appear in the Transactions tab without requiring a page refresh.
4 changes: 4 additions & 0 deletions changelog/fix-9742-blank-overview-page-without-wc-features
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix blank Payments > Overview page when WC onboarding is disabled.
4 changes: 4 additions & 0 deletions changelog/fix-9896-postal-code-label
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Localize postal code check label based on country.
4 changes: 4 additions & 0 deletions changelog/fix-9942-no-cost-subscription
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Zero dollar subscriptions with zero dollar renewals checkout error
4 changes: 4 additions & 0 deletions changelog/fix-9987-filter-csv-disputes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix filtering in async Disputes CSV export
4 changes: 4 additions & 0 deletions changelog/fix-9996-currency-conversion-fee-phrasing
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Use "currency conversion fee" instead "foreign exchange fee" in payment timeline and various other places.
4 changes: 4 additions & 0 deletions changelog/fix-ece-button-for-price-including-tax
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Show express checkout for products w/o shipping but where tax is included into price.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: fix: tokenized ECE do not show button when missing billing email


5 changes: 5 additions & 0 deletions changelog/fix-tokenized-ece-product-bundles-totals
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: fix: tokenized ECE item compatibility w/ product bundles


4 changes: 4 additions & 0 deletions changelog/update-9919-embedded-components-width
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Update Embedded Components and MOX to support custom width and paddings.
5 changes: 5 additions & 0 deletions changelog/update-s6837-reduce-api-impact-for-test-drive-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: update
Comment: Reduce the maximum number of API calls during the test-drive process and add maximum duration cut off logic.


12 changes: 8 additions & 4 deletions client/capital/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import * as React from 'react';
import { __, _n } from '@wordpress/i18n';
import { TableCard } from '@woocommerce/components';
import { dateI18n } from '@wordpress/date';

/**
* Internal dependencies.
Expand All @@ -25,6 +24,8 @@ import Chip from 'components/chip';
import { useLoans } from 'wcpay/data';
import { getAdminUrl } from 'wcpay/utils';
import './style.scss';
import { formatDateTimeFromString } from 'wcpay/utils/date-time';
import DateFormatNotice from 'wcpay/components/date-format-notice';

const columns = [
{
Expand Down Expand Up @@ -80,7 +81,7 @@ const getLoanStatusText = ( loan: CapitalLoan ) => {
return loan.fully_paid_at
? __( 'Paid off', 'woocommerce-payments' ) +
': ' +
dateI18n( 'M j, Y', loan.fully_paid_at )
formatDateTimeFromString( loan.fully_paid_at )
: __( 'Active', 'woocommerce-payments' );
};

Expand Down Expand Up @@ -112,7 +113,9 @@ const getRowsData = ( loans: CapitalLoan[] ) =>
const data = {
paid_out_at: {
value: loan.paid_out_at,
display: clickable( dateI18n( 'M j, Y', loan.paid_out_at ) ),
display: clickable(
formatDateTimeFromString( loan.paid_out_at )
),
},
status: {
value: getLoanStatusText( loan ),
Expand Down Expand Up @@ -150,7 +153,7 @@ const getRowsData = ( loans: CapitalLoan[] ) =>
value: loan.first_paydown_at,
display: clickable(
loan.first_paydown_at
? dateI18n( 'M j, Y', loan.first_paydown_at )
? formatDateTimeFromString( loan.first_paydown_at )
: '-'
),
},
Expand Down Expand Up @@ -207,6 +210,7 @@ const CapitalPage = (): JSX.Element => {

return (
<Page>
<DateFormatNotice />
<TestModeNotice currentPage="loans" />

{ wcpaySettings.accountLoans.has_active_loan && (
Expand Down
48 changes: 48 additions & 0 deletions client/capital/test/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ exports[`CapitalPage renders the TableCard component with loan data 1`] = `
<div
class=" woocommerce-payments-page"
>
<div
class="date-format-notice wcpay-banner-notice is-info"
>
<svg
aria-hidden="true"
class="wcpay-banner-notice__icon"
focusable="false"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"
/>
</svg>
<div
class="wcpay-banner-notice__content"
>
The date and time formats now match your preferences. You can update them anytime in the
<a
data-link-type="external"
href="/wp-admin/options-general.php"
>
settings
</a>
.
</div>
<button
aria-label="Dismiss this notice"
class="components-button wcpay-banner-notice__dismiss has-icon"
type="button"
>
<svg
class="gridicon gridicons-cross-small"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<g>
<path
d="M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"
/>
</g>
</svg>
</button>
</div>
<div
class="wcpay-banner-notice is-warning"
>
Expand Down
2 changes: 2 additions & 0 deletions client/capital/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ declare const global: {
accountLoans: {
has_active_loan: boolean;
};
dateFormat: string;
};
};

Expand All @@ -37,6 +38,7 @@ describe( 'CapitalPage', () => {
},
accountLoans: { has_active_loan: true },
testMode: true,
dateFormat: 'M j, Y',
};
} );

Expand Down
3 changes: 2 additions & 1 deletion client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ Object.entries( enabledPaymentMethodsConfig )
savedTokenComponent: <SavedTokenHandler api={ api } />,
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { dateI18n } from '@wordpress/date';
import moment from 'moment';

/**
* Internal dependencies
*/
import { formatCurrency } from 'multi-currency/interface/functions';
import { formatDateTimeFromString } from 'wcpay/utils/date-time';

const ExpirationDescription = ( {
feeData: { volume_allowance: volumeAllowance, end_time: endTime, ...rest },
Expand All @@ -26,7 +25,7 @@ const ExpirationDescription = ( {
'woocommerce-payments'
),
formatCurrency( volumeAllowance, currencyCode ),
dateI18n( 'F j, Y', moment( endTime ).toISOString() )
formatDateTimeFromString( endTime )
);
} else if ( volumeAllowance ) {
description = sprintf(
Expand All @@ -44,7 +43,7 @@ const ExpirationDescription = ( {
'Discounted base fee expires on %1$s.',
'woocommerce-payments'
),
dateI18n( 'F j, Y', moment( endTime ).toISOString() )
formatDateTimeFromString( endTime )
);
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe( 'AccountFees', () => {
precision: 2,
},
},
dateFormat: 'F j, Y',
};
} );

Expand Down
20 changes: 7 additions & 13 deletions client/components/active-loan-summary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
} from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { dateI18n } from '@wordpress/date';

/**
* Internal dependencies.
Expand All @@ -24,6 +23,7 @@ import { useActiveLoanSummary } from 'wcpay/data';
import { getAdminUrl } from 'wcpay/utils';

import './style.scss';
import { formatDateTimeFromTimestamp } from 'wcpay/utils/date-time';

const Block = ( {
title,
Expand Down Expand Up @@ -210,12 +210,8 @@ const ActiveLoanSummary = (): JSX.Element => {
'Repaid this period (until %s)',
'woocommerce-payments'
),
dateI18n(
'M j, Y',
new Date(
details.current_repayment_interval.due_at *
1000
)
formatDateTimeFromTimestamp(
details.current_repayment_interval.due_at
)
) }
>
Expand Down Expand Up @@ -251,9 +247,8 @@ const ActiveLoanSummary = (): JSX.Element => {
<Block
title={ __( 'Loan disbursed', 'woocommerce-payments' ) }
>
{ dateI18n(
'M j, Y',
new Date( details.advance_paid_out_at * 1000 )
{ formatDateTimeFromTimestamp(
details.advance_paid_out_at
) }
</Block>
<Block
Expand All @@ -278,9 +273,8 @@ const ActiveLoanSummary = (): JSX.Element => {
<Block
title={ __( 'First paydown', 'woocommerce-payments' ) }
>
{ dateI18n(
'M j, Y',
new Date( details.repayments_begin_at * 1000 )
{ formatDateTimeFromTimestamp(
details.repayments_begin_at
) }
</Block>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports[`Active loan summary renders correctly 1`] = `
<div
class="wcpay-loan-summary-block__title"
>
Repaid this period (until Feb 14, 2022)
Repaid this period (until Feb 15, 2022)
</div>
<div
class="wcpay-loan-summary-block__value"
Expand Down
Loading

0 comments on commit 87ad001

Please sign in to comment.