Skip to content

Commit d5bf8d8

Browse files
committed
Merge remote-tracking branch 'origin/release/9.8.0' into trunk
2 parents 618a4a7 + 88ca751 commit d5bf8d8

File tree

98 files changed

+3495
-1940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3495
-1940
lines changed

changelog.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
*** Changelog ***
22

3+
= 9.8.0 - 2025-08-11 =
4+
* Add - Adds the current setting value for the Optimized Checkout to the Stripe System Status Report data
5+
* Add - A new pill to the payment methods page to indicate the credit card requirement when the Optimized Checkout feature is enabled
6+
* Add - Tracks the toggle of the Optimized Checkout feature in the promotional banner
7+
* Fix - Force the card payment method to be enabled when the Optimized Checkout is enabled in the merchant's Payment Method Configuration
8+
* Update - Deactivates Affirm or Klarna when other official plugins are active in merchant's Payment Method Configuration
9+
* Fix - Fixes issues related to booking multiple slots with express checkout payment methods enabled
10+
* Fix - Update the Optimized Checkout promotional inbox note to link to the relevant section in the Stripe settings page
11+
* Add - Makes the Optimized Checkout feature available for all merchants by default
12+
* Add - Adds a new bulk action option to the subscriptions listing screen to check for detached payment methods
13+
* Dev - Use product type constants that were added in WooCommerce 9.7
14+
* Dev - Removes the inclusion of the deprecated WC_Stripe_Order class
15+
* Add - Introduces a new banner to promote the Optimized Checkout feature in the Stripe settings page for versions 9.8 and above
16+
* Add - Introduces a new inbox note to promote the Optimized Checkout feature on version 9.8 and later
17+
* Tweak - Use wp_ajax prefix for its built-in security for Add Payment Method action
18+
* Update - Improve Stripe API connector logging to include request/response context
19+
* Fix - Prevent Stripe API calls after several consecutive 401 (Unauthorized) responses
20+
* Fix - 3DS authentication modal not shown when using Google Pay
21+
* Update - Improve Stripe API connector logging to include request/response context
22+
* Fix - Require credit cards to be enabled before Apple Pay and Google Pay can be enabled in PMC
23+
* Fix - Free trial subscription orders with payment methods that require redirection (eg: iDeal, Bancontact)
24+
* Tweak - Update checkout error message for invalid API key to be more generic and user-friendly
25+
* Tweak - Disable Amazon Pay in the merchant's Payment Method Configuration object if it is still behind a feature flag
26+
* Fix - Only clear customer cache when an action has been performed
27+
* Fix - Remove validation error check from classic checkout before payment method creation
28+
* Dev - Clean up LPM (Local Payment Method) feature flags and related code
29+
* Dev - Move some testing and compiler node dependencies to devDependencies
30+
* Dev - Minor CSS change to comply with a SASS rule deprecation
31+
* Dev - Update SCSS to replace @import with @use and @forward
32+
* Update - Copy for the Optimized Checkout settings and notices
33+
* Update - Removes the ability to change the title for the Optimized Checkout payment element, as it is now set to "Stripe" by default
34+
* Fix - Handle missing customer when calling payment_methods API
35+
* Fix - Reduce number of calls to Stripe payment_methods API
36+
* Fix - Add `get_icon_url()` to Payment Method base class
37+
338
= 9.7.1 - 2025-07-28 =
439
* Add - Add state mapping for Lithuania in express checkout
540
* Tweak - Check for checkout validation error before creating a payment method in Stripe

client/api/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,13 @@ export default class WCStripeAPI {
178178
* @return {Promise} Promise containing the setup intent.
179179
*/
180180
setupIntent( paymentMethod, additionalData = {} ) {
181-
return this.request(
182-
this.getAjaxUrl( 'create_and_confirm_setup_intent' ),
183-
{
184-
...additionalData,
185-
action: 'create_and_confirm_setup_intent',
186-
'wc-stripe-payment-method': paymentMethod.id,
187-
'wc-stripe-payment-type': paymentMethod.type,
188-
_ajax_nonce: this.options?.createAndConfirmSetupIntentNonce,
189-
}
190-
).then( ( response ) => {
181+
return this.request( this.options?.wp_ajax_url, {
182+
...additionalData,
183+
action: 'wc_stripe_create_and_confirm_setup_intent',
184+
'wc-stripe-payment-method': paymentMethod.id,
185+
'wc-stripe-payment-type': paymentMethod.type,
186+
_ajax_nonce: this.options?.createAndConfirmSetupIntentNonce,
187+
} ).then( ( response ) => {
191188
if ( ! response.success ) {
192189
throw response.data.error;
193190
}

client/blocks/upe/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ button.stripe-gateway-stripelink-modal-trigger:hover {
2424
justify-content: center;
2525
}
2626
/* stylelint-disable selector-id-pattern */
27-
#radio-control-wc-payment-method-options-stripe__content.single-payment-element {
27+
#radio-control-wc-payment-method-options-stripe__content.optimized-checkout-element {
2828
padding-top: 1.4em;
2929

3030
.content {

client/classic/upe/deferred-intent.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ jQuery( function ( $ ) {
4141
} );
4242

4343
$( 'form.checkout' ).on( generateCheckoutEventNames(), function () {
44-
const $form = $( 'form.checkout' );
45-
// Lose focus for all fields to trigger validation
46-
$form
47-
.find( '.input-text, select, input:checkbox' )
48-
.trigger( 'validate' )
49-
.trigger( 'blur' );
50-
51-
const hasValidationErrors =
52-
$form.find( '.woocommerce-invalid' ).length > 0 &&
53-
$form.find( '.woocommerce-invalid' ).is( ':visible' );
54-
55-
// Return if there is a validation error on the checkout fields
56-
if ( hasValidationErrors ) {
57-
return;
58-
}
59-
6044
return processPaymentIfNotUsingSavedMethod( $( this ) );
6145
} );
6246

client/classic/upe/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,9 @@ jQuery( function ( $ ) {
315315
// Change the payment method container title when the Optimized Checkout is enabled
316316
if (
317317
getStripeServerData()?.isOCEnabled &&
318-
getStripeServerData()?.OCTitle &&
319318
$( 'input#payment_method_stripe' ).is( ':checked' )
320319
) {
321-
$( 'label[for=payment_method_stripe]' ).text(
322-
getStripeServerData()?.OCTitle
323-
);
320+
$( 'label[for=payment_method_stripe]' ).text( 'Stripe' );
324321
}
325322

326323
maybeClearBlikCodeValidation();

client/components/chip/styles.scss

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../styles/abstracts/styles.scss';
1+
@use '../../styles/abstracts/styles';
22

33
.wcstripe-chip {
44
font-size: 12px;
@@ -14,38 +14,38 @@
1414
gap: 2px;
1515

1616
&.wc-stripe-chip-gray {
17-
background: $wp-gray-0;
18-
color: $wp-gray-80;
17+
background: styles.$wp-gray-0;
18+
color: styles.$wp-gray-80;
1919
svg {
20-
fill: $wp-gray-80;
20+
fill: styles.$wp-gray-80;
2121
}
2222
}
2323
&.wc-stripe-chip-green {
24-
background: $wp-green-0;
25-
color: $wp-green-70;
24+
background: styles.$wp-green-0;
25+
color: styles.$wp-green-70;
2626
svg {
27-
fill: $wp-green-70;
27+
fill: styles.$wp-green-70;
2828
}
2929
}
3030
&.wc-stripe-chip-blue {
31-
background: $wp-blue-0;
32-
color: $wp-blue-70;
31+
background: styles.$wp-blue-0;
32+
color: styles.$wp-blue-70;
3333
svg {
34-
fill: $wp-blue-70;
34+
fill: styles.$wp-blue-70;
3535
}
3636
}
3737
&.wc-stripe-chip-red {
38-
background: $wp-red-0;
39-
color: $wp-red-70;
38+
background: styles.$wp-red-0;
39+
color: styles.$wp-red-70;
4040
svg {
41-
fill: $wp-red-70;
41+
fill: styles.$wp-red-70;
4242
}
4343
}
4444
&.wc-stripe-chip-yellow {
45-
background: $wp-yellow-0;
46-
color: $wp-yellow-70;
45+
background: styles.$wp-yellow-0;
46+
color: styles.$wp-yellow-70;
4747
svg {
48-
fill: $wp-yellow-70;
48+
fill: styles.$wp-yellow-70;
4949
}
5050
}
5151
}

client/components/confirmation-modal/style.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../styles/abstracts/styles.scss';
1+
@use '../../styles/abstracts/styles';
22

33
.wcstripe-confirmation-modal {
44
// increasing the specificity of the styles, to ensure it is honored
@@ -11,7 +11,7 @@
1111

1212
// to ensure that the separator extends all the way, even with different versions of Gutenberg
1313
.components-modal__content {
14-
padding: 0 $grid-unit-30 $grid-unit-30;
14+
padding: 0 styles.$grid-unit-30 styles.$grid-unit-30;
1515

1616
@media ( max-width: 599px ) {
1717
display: flex;
@@ -24,7 +24,7 @@
2424
}
2525

2626
.components-modal__header {
27-
padding: 0 $grid-unit-30;
27+
padding: 0 styles.$grid-unit-30;
2828
@media ( max-width: 599px ) {
2929
button {
3030
display: none;
@@ -33,7 +33,7 @@
3333
}
3434

3535
&__separator {
36-
margin: $grid-unit-30 -#{$grid-unit-30};
36+
margin: styles.$grid-unit-30 -#{styles.$grid-unit-30};
3737
}
3838

3939
&__footer {
@@ -42,7 +42,7 @@
4242

4343
> * {
4444
&:not( :first-child ) {
45-
margin-left: $grid-unit-20;
45+
margin-left: styles.$grid-unit-20;
4646
}
4747
}
4848
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
@import '../../styles/abstracts/styles.scss';
1+
@use '../../styles/abstracts/styles';
22

33
.wcstripe-inline-notice {
44
// increasing the specificity of the styles to override the Gutenberg ones
55
&#{&} {
66
margin: 0;
7-
margin-bottom: $grid-unit-20;
7+
margin-bottom: styles.$grid-unit-20;
88
border-left: 0;
99
padding: 12px;
1010

@@ -13,19 +13,19 @@
1313
}
1414
&.is-dismissible {
1515
padding-right: 12px;
16-
gap: $grid-unit-20;
16+
gap: styles.$grid-unit-20;
1717
}
1818
&.is-info {
19-
background: $wp-blue-0;
19+
background: styles.$wp-blue-0;
2020
}
2121
&.is-error {
22-
background: $wp-red-0;
22+
background: styles.$wp-red-0;
2323
}
2424
&.is-warning {
25-
background: $wp-yellow-0;
25+
background: styles.$wp-yellow-0;
2626
}
2727
&.is-success {
28-
background: $wp-green-0;
28+
background: styles.$wp-green-0;
2929
}
3030
}
3131
}

client/components/loadable/style.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
@import '../../styles/abstracts/styles.scss';
1+
@use '../../styles/abstracts/styles';
22

33
.is-loadable-placeholder {
44
animation: loading-fade 1.6s ease-in-out infinite;
5-
background-color: $light-gray-500;
5+
background-color: styles.$light-gray-500;
66
color: transparent;
7+
display: inline-block;
78

89
@media screen and ( prefers-reduced-motion: reduce ) {
910
animation: none;
1011
}
11-
display: inline-block;
1212

1313
&.is-inline {
1414
display: inline;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react';
2+
import { screen, render } from '@testing-library/react';
3+
import PaymentMethodRequiredForOCPill from '..';
4+
import { PAYMENT_METHOD_CARD } from 'wcstripe/stripe-utils/constants';
5+
import { useIsOCEnabled } from 'wcstripe/data';
6+
7+
jest.mock( 'wcstripe/data', () => ( {
8+
useIsOCEnabled: jest.fn(),
9+
} ) );
10+
11+
describe( 'PaymentMethodRequiredForOCPill', () => {
12+
beforeEach( () => {
13+
useIsOCEnabled.mockReturnValue( [ false, jest.fn() ] );
14+
} );
15+
16+
it( 'should render the "Required for the Optimized Checkout Suite" text', () => {
17+
useIsOCEnabled.mockReturnValue( [ true, jest.fn() ] );
18+
global.wc_stripe_settings_params = { is_oc_enabled: true };
19+
20+
render(
21+
<PaymentMethodRequiredForOCPill
22+
id={ PAYMENT_METHOD_CARD }
23+
label="Card"
24+
/>
25+
);
26+
27+
expect( screen.queryByText( 'Required' ) ).toBeInTheDocument();
28+
} );
29+
30+
it( 'should not render when OC is not active', () => {
31+
const { container } = render(
32+
<PaymentMethodRequiredForOCPill
33+
id={ PAYMENT_METHOD_CARD }
34+
label="Card"
35+
/>
36+
);
37+
38+
expect( container.firstChild ).toBeNull();
39+
} );
40+
} );

0 commit comments

Comments
 (0)