Skip to content

Commit 88d0cd0

Browse files
committed
Merge remote-tracking branch 'origin/release/9.1.0' into trunk
2 parents ff9e954 + cca9f40 commit 88d0cd0

File tree

97 files changed

+2666
-510
lines changed

Some content is hidden

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

97 files changed

+2666
-510
lines changed

.github/workflows/compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v2
2525

2626
- name: Set up dependencies caching
27-
uses: actions/cache@v2
27+
uses: actions/cache@v4
2828
with:
2929
path: ~/.cache/composer/
3030
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}

.github/workflows/js-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
node-version-file: '.nvmrc'
1717
# enable dependencies caching
18-
- uses: actions/cache@v2
18+
- uses: actions/cache@v4
1919
with:
2020
path: ~/.npm/
2121
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}

.github/workflows/linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
# clone the repository
1616
- uses: actions/checkout@v2
1717
# enable dependencies caching
18-
- uses: actions/cache@v2
18+
- uses: actions/cache@v4
1919
with:
2020
path: ~/.cache/composer/
2121
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
@@ -38,11 +38,11 @@ jobs:
3838
with:
3939
node-version-file: '.nvmrc'
4040
# enable dependencies caching
41-
- uses: actions/cache@v2
41+
- uses: actions/cache@v4
4242
with:
4343
path: ~/.cache/composer/
4444
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
45-
- uses: actions/cache@v2
45+
- uses: actions/cache@v4
4646
with:
4747
path: ~/.npm/
4848
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}

.github/workflows/php-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: actions/checkout@v2
4747

4848
- name: Set up dependencies caching
49-
uses: actions/cache@v2
49+
uses: actions/cache@v4
5050
with:
5151
path: ~/.cache/composer/
5252
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}

.github/workflows/qit-e2e-tests.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: QIT E2E tests
2+
3+
on:
4+
pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
max-parallel: 10
16+
matrix:
17+
checkout: [ 'Default', 'Legacy' ]
18+
19+
name: ${{ matrix.checkout }} QIT E2E tests
20+
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
24+
# PHP
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 7.4
29+
tools: composer
30+
coverage: none
31+
32+
- name: Cache Composer deps
33+
id: composer-cache
34+
uses: actions/cache@v4
35+
with:
36+
path: ./vendor
37+
key: ${{ runner.os }}-vendor-${{ hashFiles('composer.lock') }}
38+
39+
- name: Install composer dependencies
40+
if: ${{ steps.composer-cache.outputs.cache-hit == false }}
41+
shell: bash
42+
run: composer install --no-progress
43+
44+
# Node
45+
- name: Setup Node
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version-file: '.nvmrc'
49+
50+
- name: Cache Node deps
51+
id: node-cache
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
./node_modules
56+
~/.cache/ms-playwright
57+
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
58+
59+
- name: Install node dependencies
60+
if: ${{ steps.node-cache.outputs.cache-hit == false }}
61+
shell: bash
62+
run: npm ci
63+
64+
# Build
65+
- name: Build plugin package
66+
shell: bash
67+
run: |
68+
npm run build
69+
70+
# QIT CLI
71+
- name: Install QIT via composer
72+
run: composer require woocommerce/qit-cli --dev
73+
74+
- name: Add partner for QIT
75+
run: ./vendor/bin/qit partner:add --user='${{ secrets.PARTNER_USER }}' --application_password='${{ secrets.PARTNER_SECRET }}'
76+
77+
# E2E test environment
78+
- name: Fill in .env
79+
run: |
80+
echo 'STRIPE_PUB_KEY="${{ secrets.E2E_STRIPE_PUBLISHABLE_KEY }}"' >> .env
81+
echo 'STRIPE_SECRET_KEY="${{ secrets.E2E_STRIPE_SECRET_KEY }}"' >> .env
82+
echo 'PAYPAL_MERCHANT_ID="${{ secrets.PAYPAL_MERCHANT_ID }}"' >> .env
83+
echo 'PAYPAL_MERCHANT_EMAIL="${{ secrets.PAYPAL_MERCHANT_EMAIL }}"' >> .env
84+
echo 'PAYPAL_CLIENT_ID="${{ secrets.PAYPAL_CLIENT_ID }}"' >> .env
85+
echo 'PAYPAL_CLIENT_SECRET="${{ secrets.PAYPAL_CLIENT_SECRET }}"' >> .env
86+
echo 'PAYPAL_CUSTOMER_EMAIL="${{ secrets.PAYPAL_CUSTOMER_EMAIL }}"' >> .env
87+
echo 'PAYPAL_CUSTOMER_PASSWORD="${{ secrets.PAYPAL_CUSTOMER_PASSWORD }}"' >> .env
88+
89+
- name: Run ${{ matrix.checkout }} E2E tests
90+
shell: bash
91+
run: ./vendor/bin/qit run:e2e woocommerce-gateway-stripe ${{ matrix.checkout == 'Legacy' && 'legacy' || '' }} --source ./ --plugin woocommerce --plugin woocommerce-subscriptions --plugin woocommerce-paypal-payments:test:setup-tests --env_file .env
92+
93+
- name: Set the path in an env var
94+
if: ${{ failure() }}
95+
run: echo "E2E_REPORT_PATH=$(./vendor/bin/qit e2e-report --dir_only --local)/playwright" >> $GITHUB_ENV
96+
97+
- name: Upload ${{ matrix.checkout }} QIT E2E test results
98+
if: ${{ failure() }}
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: ${{ matrix.checkout }}-qit-e2e-test-results
102+
path: ${{ env.E2E_REPORT_PATH }}
103+
if-no-files-found: ignore
104+
retention-days: 14

assets/js/stripe.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/* global wc_stripe_params, Stripe */
22

3-
jQuery( function( $ ) {
3+
import {
4+
PAYMENT_METHOD_BOLETO,
5+
PAYMENT_METHOD_OXXO,
6+
PAYMENT_METHOD_SEPA,
7+
} from 'wcstripe/stripe-utils/constants';
8+
9+
jQuery( function($ ) {
410
'use strict';
511

612
try {
@@ -538,7 +544,7 @@ jQuery( function( $ ) {
538544
if ( wc_stripe_form.isSepaChosen() ) {
539545
extra_details.currency = $( '#stripe-sepa_debit-payment-data' ).data( 'currency' );
540546
extra_details.mandate = { notification_method: wc_stripe_params.sepa_mandate_notification };
541-
extra_details.type = 'sepa_debit';
547+
extra_details.type = PAYMENT_METHOD_SEPA;
542548

543549
return stripe.createSource( iban, extra_details ).then( wc_stripe_form.sourceResponse );
544550
}
@@ -695,7 +701,7 @@ jQuery( function( $ ) {
695701
* After the customer closes the modal proceeds with checkout normally
696702
*/
697703
handleBoleto: function () {
698-
wc_stripe_form.executeCheckout( 'boleto', function ( checkout_response ) {
704+
wc_stripe_form.executeCheckout( PAYMENT_METHOD_BOLETO, function ( checkout_response ) {
699705
stripe.confirmBoletoPayment(
700706
checkout_response.client_secret,
701707
checkout_response.confirm_payment_data
@@ -779,7 +785,7 @@ jQuery( function( $ ) {
779785
* After the customer closes the modal proceeds with checkout normally
780786
*/
781787
handleOxxo: function () {
782-
wc_stripe_form.executeCheckout( 'oxxo', function ( checkout_response ) {
788+
wc_stripe_form.executeCheckout( PAYMENT_METHOD_OXXO, function ( checkout_response ) {
783789
stripe.confirmOxxoPayment(
784790
checkout_response.client_secret,
785791
checkout_response.confirm_payment_data

changelog.txt

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

3+
= 9.1.0 - 2025-01-09 =
4+
* Fix - Fixes the new checkout experience not being enabled by default due to conflict with a migration.
5+
* Fix - Prevents duplicated credit cards to be added to the customer's account through the My Account page, the shortcode checkout and the block checkout.
6+
* Fix - Return to the correct page when redirect-based payment method fails.
7+
* Fix - Show default recipient for Payment Authentication Requested email.
8+
* Fix - Correctly handles IPP failed payments webhook calls by extracting the order ID from the payment intent metadata.
9+
* Fix - Fix ECE crash in classic cart and checkout pages for non-English language sites.
10+
* Fix - Correctly handles UK postcodes redacted by Apple Pay.
11+
* Tweak - Avoid re-sending Processing Order customer email when merchant wins dispute.
12+
* Fix - Allow the saving of iDEAL tokens when SEPA is disabled.
13+
* Fix - Fixes the incompatibility notice in editor due missing style property when instantiating Stripe payment methods.
14+
* Dev - Updates the GitHub caching action (`actions/cache`) to v4 due deprecation.
15+
* Fix - Don't update canceled order status to on-hold when a dispute is opened.
16+
* Fix - Correctly sets the dispute opened note when a dispute does not require any further action.
17+
* Add - Display Multibanco payment instruction details in Order Received page and Order Confirmation email.
18+
* Tweak - Add the transaction limit information to the Afterpay/Clearpay method when listing payment methods.
19+
* Tweak - Add transaction threshold information to Affirm when listing payment methods.
20+
* Fix - Handles additional fields when checking out using ECE on the block checkout.
21+
* Dev - Introduces new payment method name constants for the frontend.
22+
* Dev - Improves the missing intent params error log by appending the payment information array.
23+
* Tweak - Improve error message displayed when payment method creation fails in classic checkout.
24+
* Tweak - Display email address for Link saved payment methods.
25+
* Fix - Only update order status for a Radar review closed event when the order was already captured.
26+
* Dev - Introduces a new class with payment intent statuses constants.
27+
* Add - Correctly handles charge expired webhook events, setting the order status to failed and adding a note.
28+
* Fix - Allow account creation on checkout, if enabled, when purchasing subscriptions using ECE.
29+
* Tweak - Add empty check for cart when checking for allowed products for express checkout.
30+
* Tweak - Improve webhook status related messages on the settings page.
31+
* Update - Prevent editing of orders awaiting payment capture.
32+
* Add - Introduce locking and unlocking in refund flow to prevent double refund due to race condition.
33+
* Dev - Add a GitHub Action workflow to run QIT E2E Integrations tests.
34+
* Fix - Check billing interval and period to set in mandate options.
35+
* Fix - Check order currency on pay for order page to display supported payment methods.
36+
* Update - Migrate payment request settings data to express checkout settings data.
37+
* Update - Make the new Stripe Express Checkout Element enabled by default in all accounts.
38+
339
= 9.0.0 - 2024-12-12 =
440
* Fix - Fix 404 that happens when using ECE and 3D Secure auth is triggered.
541
* Fix - Set correct payment method when using Link and a card that is 3D Secure authenticated.

client/api/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getExpressCheckoutAjaxURL,
66
getRequiredFieldDataFromCheckoutForm,
77
} from 'wcstripe/express-checkout/utils';
8+
import { PAYMENT_METHOD_CASHAPP } from 'wcstripe/stripe-utils/constants';
89

910
/**
1011
* Handles generic connections to the server and Stripe.
@@ -195,7 +196,7 @@ export default class WCStripeAPI {
195196
return response.data.next_action.type;
196197
}
197198

198-
if ( response.data.payment_type === 'cashapp' ) {
199+
if ( response.data.payment_type === PAYMENT_METHOD_CASHAPP ) {
199200
// Cash App Payments.
200201
const returnURL = decodeURIComponent(
201202
response.data.return_url

client/blocks/credit-card/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ const StripeLabel = ( props ) => {
3939
};
4040

4141
const cardIcons = getStripeCreditCardIcons();
42+
const supports = {
43+
// Use `false` as fallback values in case server provided configuration is missing.
44+
showSavedCards: getBlocksConfiguration()?.showSavedCards ?? false,
45+
showSaveOption: getBlocksConfiguration()?.showSaveOption ?? false,
46+
features: getBlocksConfiguration()?.supports ?? [],
47+
};
48+
if ( getBlocksConfiguration().isAdmin ?? false ) {
49+
supports.style = getBlocksConfiguration()?.style ?? [];
50+
}
4251
const stripeCcPaymentMethod = {
4352
name: PAYMENT_METHOD_NAME,
4453
label: <StripeLabel />,
@@ -53,12 +62,7 @@ const stripeCcPaymentMethod = {
5362
'Stripe Credit Card payment method',
5463
'woocommerce-gateway-stripe'
5564
),
56-
supports: {
57-
// Use `false` as fallback values in case server provided configuration is missing.
58-
showSavedCards: getBlocksConfiguration()?.showSavedCards ?? false,
59-
showSaveOption: getBlocksConfiguration()?.showSaveOption ?? false,
60-
features: getBlocksConfiguration()?.supports ?? [],
61-
},
65+
supports,
6266
};
6367

6468
export default stripeCcPaymentMethod;

client/blocks/credit-card/use-payment-processing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
useElements,
66
} from '@stripe/react-stripe-js';
77
import { getErrorMessageForTypeAndCode } from '../../stripe-utils';
8-
import { errorTypes } from '../../stripe-utils/constants';
8+
import { errorTypes, PAYMENT_METHOD_CARD } from '../../stripe-utils/constants';
99
import { PAYMENT_METHOD_NAME } from './constants';
1010
import { getBlocksConfiguration } from 'wcstripe/blocks/utils';
1111

@@ -56,7 +56,7 @@ export const usePaymentProcessing = (
5656
: CardNumberElement;
5757
return await stripe.createPaymentMethod( {
5858
card: elements?.getElement( elementToGet ),
59-
type: 'card',
59+
type: PAYMENT_METHOD_CARD,
6060
billing_details: ownerInfo,
6161
} );
6262
};

0 commit comments

Comments
 (0)