Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release branch for 8.2.0 #9407

Merged
merged 48 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
737f579
Updates test mode instructions copy for card (#9272)
FangedParakeet Aug 19, 2024
edfd339
fix: contrast ratio for link within tooltip (#9273)
frosso Aug 19, 2024
f5b4ada
fix: platform_global_theme_support_enabled undefined index (#9280)
frosso Aug 19, 2024
a56d57a
Fix tracks identity cookie cache (#9249)
alefesouza Aug 19, 2024
d09d031
Fix QIT error `OutputNotEscaped` (#9289)
ricardo Aug 20, 2024
26a0122
Update cache after persisting the User session (#9277)
asumaran Aug 20, 2024
6943a98
Fix E2E errors (#9292)
alefesouza Aug 20, 2024
d70a50f
E2E: Fix the dispute save draft challenge failing due to redirect rac…
Jinksi Aug 21, 2024
007356a
Migrate multi-currency e2e tests to Playwright (#9175)
cesarcosta99 Aug 21, 2024
cd0e4b3
fix: missing translations, improved a11y on new testing instructions …
frosso Aug 21, 2024
9b1bb2f
Merge trunk v8.1.0 into develop
botwoo Aug 21, 2024
83b00db
update: payment method fees in one line in settings (#9287)
frosso Aug 21, 2024
039cbd5
chore: remove unused UPE appearance constants (#9299)
frosso Aug 21, 2024
0d017f6
Remove obsolete ApplePay wp-admin notice for test accounts. (#9307)
rafaelzaleski Aug 22, 2024
f9fc6a1
Pass appearance data when initiating WooPay via email input (#9310)
malithsen Aug 23, 2024
0bb0680
Fix broken Express Checkout buttons when size is set to "Large" (#9327)
asumaran Aug 24, 2024
9c2202f
Make correction to changelog entry for Docker compose v2 improvement …
Jinksi Aug 26, 2024
ad1395d
fix: testing instructions dark theme support (#9295)
frosso Aug 26, 2024
1a1616e
Send blog timezone to WooPay (#9325)
alefesouza Aug 26, 2024
244b7c9
Fix logic to retrieve initial shipping rates for ECE on shortcode car…
rafaelzaleski Aug 26, 2024
6e983cb
Disables test instructions clipboard button on insecure sites (#9330)
FangedParakeet Aug 27, 2024
d885477
Apply some fixes in the e2e tests scripts (#9315)
cesarcosta99 Aug 27, 2024
cb9c090
Temporarily disables custom field detection notices (#9329)
FangedParakeet Aug 28, 2024
8963777
Update Jetpack packages for ver 8.2.0 (#9349)
htdat Aug 28, 2024
1f8d7d7
Support merchant site styles for WooPay when initializing through cla…
malithsen Aug 28, 2024
477fa2b
Move WooPay global theme checkbox to the appearance section (#9321)
malithsen Aug 28, 2024
a9cfe1e
Change WooPay session route namespace (#9317)
alefesouza Aug 28, 2024
955571e
Fix Connect page scrolls to top when the Enable Sandbox Mode button i…
mordeth Aug 29, 2024
29d98ec
Merge trunk v8.1.1 into develop
botwoo Aug 29, 2024
6e2fc65
Redirect user to WooPay OTP when the email is saved (#9354)
alefesouza Aug 29, 2024
ea84f7a
Fix saved cards e2e tests (#9359)
timur27 Aug 30, 2024
0dd2726
Dev: Fix Klarna product page message E2E test (#9361)
danielmx-dev Aug 30, 2024
e1ac4cf
Merge PR #9369 into develop
achyuthajoy Aug 30, 2024
638a650
Fix BNPL payment method messaging loading state (#9355)
cesarcosta99 Aug 30, 2024
32b1a90
Merge PR #9371 into develop
alopezari Aug 31, 2024
0bd29ce
Remove the override css for the express payment grid. (#9248)
alexflorisca Sep 3, 2024
eb584b2
Upgrade docker image to PHP 8.1 (#9146)
achyuthajoy Sep 3, 2024
81e3207
Bump required PHP version to 7.3 (#9388)
alopezari Sep 5, 2024
64b54f3
add: test instructions icon animation (#9290)
frosso Sep 6, 2024
f65efc5
Fixed default borderRadius value for the express checkout buttons (#9…
gpressutto5 Sep 6, 2024
1b17a55
Add connect.js library and embedded onboarding integration (#9251)
dmallory42 Sep 6, 2024
2eea958
Fix and improve admin child pages redirections logic (#9400)
vladolaru Sep 6, 2024
f87ea8e
Dev: Move Klarna E2E tests to Playwright (#9377)
danielmx-dev Sep 6, 2024
f34c48c
Check payment method is available before rendering it (#9378)
asumaran Sep 6, 2024
9e95662
Add ExPlat experiment: Payments task onboarding flow skips Connect pa…
vladolaru Sep 6, 2024
a588f89
Update version and add changelog entries for release 8.2.0
github-actions[bot] Sep 8, 2024
2ce85a5
Add error handling for `loadError` in ECE (#9416)
rafaelzaleski Sep 11, 2024
823a59c
Amend changelog entries for release 8.2.0
botwoo Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
woocommerce: [ 'latest' ]
wordpress: [ 'latest' ]
php: [ '7.4' ]
php: [ '7.4', '8.1' ]
directory: [ 'includes', 'src' ]
env:
WP_VERSION: ${{ matrix.wordpress }}
Expand All @@ -36,6 +36,6 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: xdebug2
coverage: xdebug
# run CI checks
- run: bash bin/run-ci-tests-check-coverage.bash
1 change: 1 addition & 0 deletions assets/images/icons/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions bin/check-test-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ docker compose exec -u www-data wordpress \

echo "Checking coverage..."

docker compose exec -u www-data wordpress \
php -d xdebug.remote_autostart=on \
/var/www/html/wp-content/plugins/woocommerce-payments/vendor/bin/phpunit \
--configuration "/var/www/html/wp-content/plugins/woocommerce-payments/$CONFIGURATION_FILE" \
--coverage-html /var/www/html/php-test-coverage \
--coverage-clover /var/www/html/clover.xml
docker-compose exec -u www-data wordpress \
/var/www/html/wp-content/plugins/woocommerce-payments/vendor/bin/phpunit \
--configuration "/var/www/html/wp-content/plugins/woocommerce-payments/$CONFIGURATION_FILE" \
--coverage-html /var/www/html/php-test-coverage \
--coverage-clover /var/www/html/clover.xml

./vendor/bin/coverage-check docker/wordpress/clover.xml $COVERAGE
4 changes: 1 addition & 3 deletions bin/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ if $WATCH_FLAG; then
# Change directory to WooCommerce Payments' root in order to have access to .phpunit-watcher.yml
docker compose exec -u www-data wordpress bash -c \
"cd /var/www/html/wp-content/plugins/woocommerce-payments && \
php -d xdebug.remote_autostart=on \
./vendor/bin/phpunit-watcher watch --configuration ./phpunit.xml.dist $*"
else
echo "Running the tests..."

docker compose exec -u www-data wordpress \
php -d xdebug.remote_autostart=on \
docker-compose exec -u www-data wordpress \
/var/www/html/wp-content/plugins/woocommerce-payments/vendor/bin/phpunit \
--configuration /var/www/html/wp-content/plugins/woocommerce-payments/phpunit.xml.dist \
$*
Expand Down
33 changes: 32 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
*** WooPayments Changelog ***

= 8.2.0 - 2024-09-11 =
* Add - add: test instructions icon animation
* Add - Added Embdedded KYC, currently behind feature flag.
* Fix - Avoid unnecessary account data cache refresh on WooPayments pages refresh.
* Fix - Check payment method is available before rendering it.
* Fix - Disables custom checkout field detection due to compatibility issues and false positives.
* Fix - Disables testing instructions clipboard button on HTTP sites when navigator.clipboard is undefined.
* Fix - fix: missing translations on testing instructions.
* Fix - fix: platform_global_theme_support_enabled undefined index
* Fix - fix: testing instructions dark theme support
* Fix - Fix caching with tracking cookie.
* Fix - Fixed an issue where the Connect page would scroll to the top upon clicking the Enable Sandbox Mode button.
* Fix - Fixed default borderRadius value for the express checkout buttons
* Fix - Fix shipping rates retrieval method for shortcode cart/checkout.
* Fix - Fix support for merchant site styling when initializing WooPay via classic checkout
* Fix - Fix WooPay direct checkout.
* Fix - Handle loadError in ECE for Block Context Initialization.
* Fix - Move woopay theme support checkbox to the appearance section.
* Fix - Pass appearance data when initiating WooPay via the email input flow
* Fix - Prevent preload of BNPL messaging if minimum order amount isn't hit.
* Fix - Redirect user to WooPay OTP when the email is saved.
* Fix - Remove obsolete ApplePay warning on wp-admin for test sites.
* Fix - Update cache after persisting the User session via WooPay
* Fix - Updates test mode instructions copy for cards at checkout.
* Update - update: payment method fees in one line
* Update - Update Jetpack packages to the latest versions
* Dev - Fix failing e2e tests for saved cards.
* Dev - Fix Klarna product page message E2E test after the contents inside the iframe were updated.
* Dev - Migrate Klarna E2E tests to playwright. Reduce noise in E2E tests console output.
* Dev - Migrate multi-currency e2e tests to Playwright.

= 8.1.1 - 2024-08-29 =
* Fix - Ensure 55px is the maximum height for Apple Pay button.
* Fix - Fixed sandbox mode accounts being able to disable test mode for the payment gateway settings.
Expand All @@ -24,7 +55,6 @@
* Fix - Fix uncaught error on the block based Cart page when WooPayments is disabled.
* Fix - Fix WooPay checkboxes while signed in.
* Fix - If a payment method fails to be created in the frontend during checkout, forward the errors to the server so it can be recorded in an order.
* Fix - Migrate to Docker Compose V2 for test runner environment setup scripts
* Fix - Reverts changes related to Direct Checkout that broke the PayPal extension.
* Fix - Translate hardcoded strings on the Connect page
* Update - refactor: separate BNPL methods from settings list
Expand All @@ -36,6 +66,7 @@
* Dev - Match the Node version in nvm with the minimum version in package.json.
* Dev - Remove unnecessary console.warn statements added in #9121.
* Dev - Update bundle size checker workflow to support node v20
* Dev - Migrate to Docker Compose V2 for test runner environment setup scripts

= 8.0.2 - 2024-08-07 =
* Fix - Add opt-in checks to prevent blocking customers using other payment methods.
Expand Down
5 changes: 0 additions & 5 deletions changelog/update-e2e-setup-script

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/update-e2e-setup-script-env-var

This file was deleted.

1 change: 1 addition & 0 deletions client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { handleWooPayEmailInput } from '../woopay/email-input-iframe';
import { recordUserEvent } from 'tracks';
import wooPayExpressCheckoutPaymentMethod from '../woopay/express-button/woopay-express-checkout-payment-method';
import { isPreviewing } from '../preview';
import '../utils/copy-test-number';

const upeMethods = {
card: PAYMENT_METHOD_NAME_CARD,
Expand Down
1 change: 1 addition & 0 deletions client/checkout/blocks/payment-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const PaymentElements = ( { api, ...props } ) => {
errorMessage={ errorMessage }
fingerprint={ fingerprint }
onLoadError={ setPaymentProcessorLoadErrorMessage }
theme={ appearance?.theme }
{ ...props }
/>
</Elements>
Expand Down
6 changes: 5 additions & 1 deletion client/checkout/blocks/payment-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '@woocommerce/blocks-registry';
import { __ } from '@wordpress/i18n';
import { useEffect, useRef } from 'react';
import classNames from 'classnames';

/**
* Internal dependencies
Expand Down Expand Up @@ -64,6 +65,7 @@ const PaymentProcessor = ( {
shouldSavePayment,
fingerprint,
onLoadError = noop,
theme,
} ) => {
const stripe = useStripe();
const elements = useElements();
Expand Down Expand Up @@ -267,7 +269,9 @@ const PaymentProcessor = ( {
<>
{ isTestMode && (
<p
className="content"
className={ classNames( 'content', {
[ `theme--${ theme }` ]: theme,
} ) }
dangerouslySetInnerHTML={ {
__html: testingInstructions,
} }
Expand Down
8 changes: 2 additions & 6 deletions client/checkout/blocks/style.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@import '../style';

.wcpay-payment-element {
margin-bottom: 2rem;
}

.wcpay-card-mounted {
background-color: #fff;
}

/* stylelint-disable-next-line selector-id-pattern */
#express-payment-method-woopay {
width: 100%;
Expand Down Expand Up @@ -77,8 +75,6 @@ button.wcpay-stripelink-modal-trigger:hover {

#remember-me {
margin: 36px 0 0 0;
padding: 0;
border: 0;

h2 {
font-size: 18px;
Expand Down
1 change: 1 addition & 0 deletions client/checkout/classic/event-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { handleWooPayEmailInput } from 'wcpay/checkout/woopay/email-input-iframe
import { isPreviewing } from 'wcpay/checkout/preview';
import { recordUserEvent } from 'tracks';
import { SHORTCODE_BILLING_ADDRESS_FIELDS } from 'wcpay/checkout/constants';
import '../utils/copy-test-number';

jQuery( function ( $ ) {
enqueueFraudScripts( getUPEConfig( 'fraudServices' ) );
Expand Down
9 changes: 8 additions & 1 deletion client/checkout/classic/payment-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,20 @@ async function createStripePaymentElement(
) {
const amount = Number( getUPEConfig( 'cartTotal' ) );
const paymentMethodTypes = getPaymentMethodTypes( paymentMethodType );
const appearance = await initializeAppearance( api, elementsLocation );
document
.querySelector(
`.wcpay-upe-element[data-payment-method-type="${ paymentMethodType }"]`
)
?.closest( '.wc_payment_method' )
?.classList.add( `theme--${ appearance.theme || 'stripe' }` );
const options = {
mode: amount < 1 ? 'setup' : 'payment',
currency: getUPEConfig( 'currency' ).toLowerCase(),
amount: amount,
paymentMethodCreation: 'manual',
paymentMethodTypes: paymentMethodTypes,
appearance: await initializeAppearance( api, elementsLocation ),
appearance,
fonts: getFontRulesFromPage(),
};

Expand Down
2 changes: 2 additions & 0 deletions client/checkout/classic/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../style';

#payment .payment_method_woocommerce_payments .testmode-info {
margin-bottom: 0.5em;
}
Expand Down
1 change: 0 additions & 1 deletion client/checkout/express-checkout-buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
margin-top: 1em;
width: 100%;
clear: both;
margin-bottom: 1.5em;

.woocommerce-cart & {
margin-bottom: 0;
Expand Down
63 changes: 53 additions & 10 deletions client/checkout/style.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,57 @@
#wcpay-card-element {
border: 1px solid #ddd;
padding: 5px 7px;
min-height: 29px;
margin-bottom: 0.5rem;
#payment .payment_method_woocommerce_payments .woocommerce-error {
margin: 1rem 0;
}

.wcpay-card-mounted {
background-color: #fff;
}
.js-woopayments-copy-test-number {
line-height: 1.2em;
vertical-align: middle;
border-radius: 0;
border: none !important;
// some themes might override the color on all `button`s - whose selector has higher specificity and our class selector.
background-color: transparent !important;
font-weight: normal;
display: inline-flex;
cursor: pointer;
color: inherit;
font-size: initial;
padding: 2px 1px;
align-items: center;

#payment .payment_method_woocommerce_payments .woocommerce-error {
margin: 1rem 0;
span {
margin-right: 4px;
}

i {
order: 1;
display: block;
width: 1.2em;
height: 1.2em;
background: url( 'assets/images/icons/copy.svg?asset' ) no-repeat center;
background-size: contain;
}

&:hover {
background-color: transparent;
filter: invert( 0.3 );

i {
filter: invert( 0.3 );
}
}

&:active i {
transform: scale( 0.9 );
}

&.state--success {
i {
background-image: url( 'assets/images/icons/check-green.svg?asset' );
}
}

.theme--night & {
i {
filter: invert( 100% ) hue-rotate( 180deg );
}
}
}
24 changes: 24 additions & 0 deletions client/checkout/upe-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,27 @@ export const appearanceSelectors = {
buttonSelectors: [ '.wc-block-cart__submit-button' ],
linkSelectors: [ 'a' ],
},
wooPayClassicCheckout: {
appendTarget: '.woocommerce-billing-fields__field-wrapper',
upeThemeInputSelector: '#billing_first_name',
upeThemeLabelSelector: '.woocommerce-checkout .form-row label',
rowElement: 'p',
validClasses: [ 'form-row' ],
invalidClasses: [
'form-row',
'woocommerce-invalid',
'woocommerce-invalid-required-field',
],
backgroundSelectors: [
'#customer_details',
'#order_review',
'form.checkout',
'body',
],
headingSelectors: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
buttonSelectors: [ '#place_order' ],
linkSelectors: [ 'a' ],
},

/**
* Update selectors to use alternate if not present on DOM.
Expand Down Expand Up @@ -175,6 +196,9 @@ export const appearanceSelectors = {
case 'bnpl_cart_block':
appearanceSelector = this.bnplCartBlock;
break;
case 'woopay_shortcode_checkout':
appearanceSelector = this.wooPayClassicCheckout;
break;
}

return {
Expand Down
52 changes: 52 additions & 0 deletions client/checkout/utils/copy-test-number.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';

let previousTimeoutRef = null;

document.addEventListener(
'click',
function ( event ) {
// using "closest", just in case the user clicks on the icon.
const copyNumberButton = event.target?.closest(
'.js-woopayments-copy-test-number'
);
if ( ! copyNumberButton ) {
return;
}

event.preventDefault();
const number = copyNumberButton.querySelector( 'span' ).innerText;

if ( ! navigator.clipboard ) {
prompt(
__( 'Copy the test number:', 'woocommerce-payments' ),
number
);
return;
}
navigator.clipboard.writeText( number );

window.wp?.data
?.dispatch( 'core/notices' )
?.createInfoNotice(
__(
'Test number copied to your clipboard!',
'woocommerce-payments'
),
{
// the unique `id` prevents the JS from creating multiple notices with the same text before they're dismissed.
id: 'woopayments/test-number-copied',
type: 'snackbar',
context: 'wc/checkout/payments',
}
);
copyNumberButton.classList.add( 'state--success' );
clearTimeout( previousTimeoutRef );
previousTimeoutRef = setTimeout( () => {
copyNumberButton.classList.remove( 'state--success' );
}, 2000 );
},
false
);
2 changes: 1 addition & 1 deletion client/checkout/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getAppearanceType = () => {
}

if ( document.querySelector( '.woocommerce-billing-fields' ) ) {
return 'shortcode_checkout';
return 'woopay_shortcode_checkout';
}

if ( document.querySelector( '.wp-block-woocommerce-cart' ) ) {
Expand Down
Loading
Loading