Skip to content

Commit

Permalink
Merge branch 'develop' into add/10382-adds-store-id-to-tracker-reques…
Browse files Browse the repository at this point in the history
…t-body
  • Loading branch information
FangedParakeet authored Feb 19, 2025
2 parents 5f7087d + 570cc98 commit 9fa2de4
Show file tree
Hide file tree
Showing 70 changed files with 916 additions and 576 deletions.
4 changes: 4 additions & 0 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
background-image: url( '../images/payment-methods/grabpay.svg' );
}

.payment-method__brand--wechat_pay {
background-image: url( '../images/payment-methods/wechat-pay.svg' );
}

.wc_gateways tr[data-gateway_id='woocommerce_payments'] .payment-method__icon {
border: 1px solid #ddd;
border-radius: 2px;
Expand Down
7 changes: 0 additions & 7 deletions assets/images/payment-methods/woopay.svg

This file was deleted.

2 changes: 1 addition & 1 deletion bin/wcpay-live-branches/wcpay-live-branches.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
*/
function appendHtml( el, contents ) {
const $el = $( el );
const wooColor = '#7F54B3'; // https://woocommerce.com/brand-and-logo-guidelines/
const wooColor = '#873eff'; // https://woocommerce.com/brand-and-logo-guidelines/
const styles = $( '<style>' ).text( `
#wcpay-live-branches {
border: 3px dotted ${ wooColor };
Expand Down
4 changes: 4 additions & 0 deletions changelog/add-10390-stripe-notifications-component-loader
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: add

Add loader indication for Stripe notifications banner component
4 changes: 0 additions & 4 deletions changelog/add-9129-account-management-component

This file was deleted.

4 changes: 4 additions & 0 deletions changelog/add-grabpay-pm-details
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Add GrabPay payment method details to the View Transaction page.
4 changes: 4 additions & 0 deletions changelog/add-wechat-checkout-support
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Add WeChat Pay support to checkout.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Add new E2E tests to make sure a non-admin user, such as an editor, can access the wp-admin without errors.
5 changes: 5 additions & 0 deletions changelog/feat-tokenized-ece-account-meta-control
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: dev: ability to disable the Tokenized ECE via server-side flag


4 changes: 4 additions & 0 deletions changelog/fix-10393-frt-advanced-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix the default value of the FRT advanced options.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Improve how Stripe Billing integration is loaded to prevent unnecessary queries on every page load.
4 changes: 4 additions & 0 deletions changelog/fix-missed-woo-colors
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix Stripe KYC flow Woo color
4 changes: 4 additions & 0 deletions changelog/update-10317
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Update the copy in the existing modal for resetting a WooPayments account.
4 changes: 4 additions & 0 deletions changelog/update-10317-change-reset-account-modal-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Update copy in the Woopayments Reset account modal for incomplete onboarding accounts
4 changes: 4 additions & 0 deletions changelog/update-add-min-amount-to-capture-error
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Add JSON-formatted minimum amount details to the amount too small error message.
2 changes: 2 additions & 0 deletions client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
PAYMENT_METHOD_NAME_AFTERPAY,
PAYMENT_METHOD_NAME_KLARNA,
PAYMENT_METHOD_NAME_GRABPAY,
PAYMENT_METHOD_NAME_WECHAT_PAY,
} from '../constants.js';
import { getDeferredIntentCreationUPEFields } from './payment-elements';
import { handleWooPayEmailInput } from '../woopay/email-input-iframe';
Expand All @@ -65,6 +66,7 @@ const upeMethods = {
afterpay_clearpay: PAYMENT_METHOD_NAME_AFTERPAY,
klarna: PAYMENT_METHOD_NAME_KLARNA,
grabpay: PAYMENT_METHOD_NAME_GRABPAY,
wechat_pay: PAYMENT_METHOD_NAME_WECHAT_PAY,
};

const enabledPaymentMethodsConfig = getUPEConfig( 'paymentMethodsConfig' );
Expand Down
2 changes: 2 additions & 0 deletions client/checkout/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const PAYMENT_METHOD_NAME_AFTERPAY =
'woocommerce_payments_afterpay_clearpay';
export const PAYMENT_METHOD_NAME_KLARNA = 'woocommerce_payments_klarna';
export const PAYMENT_METHOD_NAME_GRABPAY = 'woocommerce_payments_grabpay';
export const PAYMENT_METHOD_NAME_WECHAT_PAY = 'woocommerce_payments_wechat_pay';
export const PAYMENT_METHOD_NAME_EXPRESS_CHECKOUT_ELEMENT =
'woocommerce_payments_express_checkout';
export const PAYMENT_METHOD_NAME_WOOPAY_EXPRESS_CHECKOUT =
Expand All @@ -36,6 +37,7 @@ export function getPaymentMethodsConstants() {
PAYMENT_METHOD_NAME_CARD,
PAYMENT_METHOD_NAME_KLARNA,
PAYMENT_METHOD_NAME_GRABPAY,
PAYMENT_METHOD_NAME_WECHAT_PAY,
];
}

Expand Down
10 changes: 5 additions & 5 deletions client/components/fraud-risk-tools-banner/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
}

&__new-feature-pill.wcpay-pill {
color: #3c2861;
border: 1px solid #3c2861;
color: #3c087e;
border: 1px solid #3c087e;
font-size: 12px;
line-height: 14px;
border-radius: 14px;
margin: 0;
}

&__header {
color: #271b3d;
color: #2c045d;
font-style: normal;
font-weight: 400;
font-size: 20px;
Expand All @@ -29,7 +29,7 @@
}

&__body {
color: #271b3d;
color: #2c045d;
font-size: 13px;
line-height: 16px;
margin: 0 0 16px;
Expand All @@ -56,7 +56,7 @@
}

&.is-tertiary {
color: #271b3d;
color: #2c045d;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions client/components/payment-method-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const formatDetails = ( payment ) => {
case 'affirm':
case 'afterpay_clearpay':
case 'klarna':
case 'wechat_pay':
default:
return <Fragment />;
}
Expand Down
2 changes: 1 addition & 1 deletion client/components/payment-method-logos/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Bancontact from 'assets/images/payment-methods/bancontact.svg?asset';
import Eps from 'assets/images/payment-methods/eps.svg?asset';
import Becs from 'assets/images/payment-methods/becs.svg?asset';
import Przelewy24 from 'assets/images/payment-methods/przelewy24.svg?asset';
import WeChatPay from 'assets/images/payment-method-icons/wechat_pay.svg?asset';
import WeChatPay from 'assets/images/payment-method-icons/wechat-pay.svg?asset';
import './style.scss';

const PaymentMethods = [
Expand Down
1 change: 0 additions & 1 deletion client/constants/payment-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const PAYMENT_METHOD_TITLES = {
stripe_account: __( 'Stripe Account', 'woocommerce-payments' ),
unionpay: __( 'Union Pay', 'woocommerce-payments' ),
visa: __( 'Visa', 'woocommerce-payments' ),
wechat: __( 'WeChat', 'woocommerce-payments' ),
wechat_pay: __( 'WeChat Pay', 'woocommerce-payments' ),
};

Expand Down
16 changes: 11 additions & 5 deletions client/data/authorizations/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface WCPayError {
minimum_amount?: number;
minimum_amount_currency?: string;
};
error_type?: string;
};
}

Expand Down Expand Up @@ -82,10 +83,16 @@ const getErrorMessage = ( apiError: WCPayError ): string => {
'This payment cannot be processed in its current state.',
'woocommerce-payments'
),
wcpay_capture_error: __(
'The payment capture failed to complete.',
'woocommerce-payments'
),
// eslint-disable-next-line @typescript-eslint/naming-convention
wcpay_capture_error: ( error: WCPayError ): string => {
if ( error.data?.error_type === 'amount_too_small' ) {
return getAmountTooSmallError( error );
}
return __(
'The payment capture failed to complete.',
'woocommerce-payments'
);
},
wcpay_cancel_error: __(
'The payment cancellation failed to complete.',
'woocommerce-payments'
Expand All @@ -94,7 +101,6 @@ const getErrorMessage = ( apiError: WCPayError ): string => {
'An unexpected error occurred. Please try again later.',
'woocommerce-payments'
),
wcpay_capture_error_amount_too_small: getAmountTooSmallError,
};

const errorHandler = errorMessages[ apiError.code ?? '' ];
Expand Down
6 changes: 4 additions & 2 deletions client/data/authorizations/test/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,14 @@ describe( 'Authorizations actions', () => {

// Mock API error for amount too small
const apiError = {
code: 'wcpay_capture_error_amount_too_small',
code: 'wcpay_capture_error',
data: {
status: 400,
extra_details: {
minimum_amount: 50,
minimum_amount_currency: 'USD',
},
error_type: 'amount_too_small',
},
};

Expand All @@ -300,9 +301,10 @@ describe( 'Authorizations actions', () => {

// Mock API error for amount too small
const apiError = {
code: 'wcpay_capture_error_amount_too_small',
code: 'wcpay_capture_error',
data: {
status: 400,
error_type: 'amount_too_small',
},
};

Expand Down
23 changes: 20 additions & 3 deletions client/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
ConnectNotificationBanner,
} from '@stripe/react-connect-js';
import { recordEvent } from 'wcpay/tracks';
import StripeSpinner from 'wcpay/components/stripe-spinner';

const OverviewPageError = () => {
const queryParams = getQuery();
Expand Down Expand Up @@ -94,6 +95,9 @@ const OverviewPage = () => {
setLoadErrorMessage: setStripeNotificationsBannerErrorMessage,
appearance,
} );
const [ stripeComponentLoading, setStripeComponentLoading ] = useState(
true
);

const isTestModeOnboarding = wcpaySettings.testModeOnboarding;
const { isLoading: settingsIsLoading } = useSettings();
Expand Down Expand Up @@ -191,6 +195,7 @@ const OverviewPage = () => {
if ( stripeNotificationsBannerErrorMessage ) {
setShowUpdateDetailsTask( true );
setShowGetVerifyBankAccountTask( true );
setStripeComponentLoading( false );
}
}, [ stripeNotificationsBannerErrorMessage ] );

Expand Down Expand Up @@ -220,6 +225,9 @@ const OverviewPage = () => {
total_count: response.total,
} );
}
// If the component inits successfully, this function is always called.
// It's safe to set the loading false here rather than onLoaderStart, because it happens too early and the UX is not smooth.
setStripeComponentLoading( false );
};

return (
Expand Down Expand Up @@ -270,6 +278,14 @@ const OverviewPage = () => {
<ErrorBoundary>
<Welcome />

{ stripeComponentLoading &&
accountStatus.status !== 'complete' && (
<Card>
<div className="stripe-notifications-banner-loader">
<StripeSpinner />
</div>
</Card>
) }
{ stripeConnectInstance && (
<div
className="stripe-notifications-banner-wrapper"
Expand All @@ -284,12 +300,13 @@ const OverviewPage = () => {
connectInstance={ stripeConnectInstance }
>
<ConnectNotificationBanner
onLoadError={ ( loadError ) =>
onLoadError={ ( loadError ) => {
setStripeNotificationsBannerErrorMessage(
loadError.error.message ||
'Unknown error'
)
}
);
setStripeComponentLoading( false );
} }
collectionOptions={ {
fields: 'eventually_due',
futureRequirements: 'omit',
Expand Down
12 changes: 8 additions & 4 deletions client/overview/modal/reset-account/strings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ export default {
? sprintf(
/* translators: 1: WooPayments. */
__(
'When you reset your test account, all data — including your %1$s account details, test transactions, and payouts history — will be lost. This action cannot be undone, but you can create a new test account at any time.',
'When you reset your test account, all payment data — including your %1$s account details, test transactions, and payouts history — will be lost. Your order history will remain. This action cannot be undone, but you can create a new test account at any time.',
'woocommerce-payments'
),
'WooPayments'
)
: __(
'If you are experiencing problems completing account setup, or need to change the email/country associated with your account, you can reset your account and start from the beginning.',
'woocommerce-payments'
: sprintf(
/* translators: 1: WooPayments. */
__(
'When you reset your account, all payment data — including your %1$s account details, test transactions, and payouts history — will be lost. Your order history will remain. This action cannot be undone, but you can create a new test account at any time.',
'woocommerce-payments'
),
'WooPayments'
),
beforeContinue: __( 'Before you continue', 'woocommerce-payments' ),
step1: sprintf(
Expand Down
2 changes: 1 addition & 1 deletion client/overview/modal/reset-account/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe( 'Reset Account Modal', () => {

expect(
screen.queryByText(
'If you are experiencing problems completing account setup, or need to change the email/country associated with your account, you can reset your account and start from the beginning.'
'When you reset your account, all payment data — including your WooPayments account details, test transactions, and payouts history — will be lost. Your order history will remain. This action cannot be undone, but you can create a new test account at any time.'
)
).toBeInTheDocument();
} );
Expand Down
8 changes: 8 additions & 0 deletions client/overview/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
margin-right: -1px;
}

.stripe-notifications-banner-loader {
width: min( 680px, 90vw ); /* Keeps it 680px max but adapts */
height: 160px;
display: flex;
justify-content: center;
align-items: center;
}

.wcpay-setup-real-payments {
&__body {
display: grid;
Expand Down
Loading

0 comments on commit 9fa2de4

Please sign in to comment.