Skip to content

Commit

Permalink
Merge release/7.1.0 into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mgascam committed Jan 25, 2024
2 parents df8906d + 30e54c5 commit 047f334
Show file tree
Hide file tree
Showing 175 changed files with 4,375 additions and 5,254 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/e2e-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ jobs:
strategy:
fail-fast: false
matrix:
test_groups: [ 'wcpay', 'subscriptions', 'upe', 'upeSplit' ] # [TODO] Unskip blocks tests after investigating constant failures.
test_groups: [ 'wcpay', 'subscriptions' ] # [TODO] Unskip blocks tests after investigating constant failures.
test_branches: [ 'merchant', 'shopper' ]
exclude:
- test_groups: 'upe'
test_branches: 'merchant'
- test_groups: 'upeSplit'
test_branches: 'merchant'

name: WC - latest | ${{ matrix.test_groups }} - ${{ matrix.test_branches }}

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/e2e-tests-atomic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
test_groups: [ 'wcpay', 'subscriptions', 'upe', 'upeSplit' ]
test_groups: [ 'wcpay', 'subscriptions' ]
test_branches: [ 'merchant', 'shopper' ]
exclude:
- test_groups: 'subscriptions'
- test_groups: 'wcpay'
test_branches: 'merchant'
- test_groups: 'upe'
test_branches: 'merchant'
- test_groups: 'upeSplit'
test_branches: 'merchant'

env:
E2E_GROUP: ${{ matrix.test_groups }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ We currently support the following variables:

## Test account setup

For setting up a test account follow [these instructions](https://woo.com/document/woopayments/testing-and-troubleshooting/dev-mode/).
For setting up a test account follow [these instructions](https://woo.com/document/woopayments/testing-and-troubleshooting/sandbox-mode/).

You will need a externally accessible URL to set up the plugin. You can use ngrok for this.

Expand Down
1 change: 0 additions & 1 deletion assets/images/illustrations/po-eligibility.svg

This file was deleted.

49 changes: 49 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
*** WooPayments Changelog ***

= 7.1.0 - 2024-01-25 =
* Add - Add active plugins array to compatibility data.
* Add - Add post_types and their counts as an array to compatibility data.
* Add - Add the active theme name of the blog to the compatibility service
* Add - Expose the refund transaction ID in WooCommerce Order Refund API
* Add - Select the proper payment element when using saved Stripe Link tokens or choosing to use Stripe Link for new email.
* Add - Track filtering interactions on the Transactions page.
* Fix - Allow subscription purchase via Payment Request when no shipping methods are present.
* Fix - Allow zero-amount refunds for backwards compatibility with basic payment gateway and to allow re-stock of refunded orders.
* Fix - Checking if wcpayPaymentRequestPayForOrderParams before using it in Pay for Order page
* Fix - Checkout error when page URL is too long
* Fix - Comment: Fix QIT security tests errors.
* Fix - Fix incorrect test mode notice when left KYC early after going live from builder mode
* Fix - Fix network error that occurs when viewing an test mode order with test mode disabled, and vice versa.
* Fix - fix pay-for-order quirks and 3DS behavior
* Fix - Fix Safe Mode message reversed host
* Fix - Fix Stripe Link autofill on checkout.
* Fix - Fix Stripe Link button alignment in the Checkout Block
* Fix - Hide the transaction details refund menu for ineligble disputed transactions
* Fix - Improve clarity & readability of disputed order notice (not all text bold).
* Fix - Prevent possible fatal when using get_edit_post_link filter.
* Fix - Re-render WooPay button when cart updates, when checkout updates.
* Fix - Reinstate first deposit waiting period notice in payments overview (fix bug)
* Fix - Remove unnecessary import statement which leads to a warning when first loaded
* Fix - Resolved an error that would occur with WC 8.5.0 when editing a subscription customer from the admin dashboard.
* Fix - Resolved an issue that caused ordering the Admin Subscriptions List Table to not work when HPOS is enabled.
* Fix - Restock order items when performing full refund from transaction details page
* Fix - Reverting to manual styling over native WordPress components to fix CSS defects on Analytics page
* Fix - Send metadata in error message
* Fix - Show the correct number of days in the new account waiting period notice.
* Fix - Update WooPay tablet breakpoint.
* Fix - Verify that order exists before offering "Partial refund" option on transaction details page.
* Update - Changed the edit subscription product "Expire after" (Subscription length) so it more clearly describes when a subscription will automatically stop renewing.
* Update - Pass currency parameter and not transaction_ids parameter when creating instant deposit.
* Update - Store balance transaction ID in order metadata.
* Update - Updated BNPL sorting in settings for consistency with onboarding.
* Update - Update references to dev mode to use sandbox mode terminology.
* Update - Updates to the styling of the onboarding mode selection page.
* Update - Update style of notices within the deposits section of the settings screen.
* Dev - Added enum class for country codes
* Dev - Add new Tracks events to WooPay Save My Info checkbox
* Dev - Allow test pipelines to pass by slightly adjusting HTML selectors
* Dev - Merge UPE tests into the single and main gateway test file for unit and E2E tests.
* Dev - Place order button Tracks
* Dev - Track payment-request-button loads
* Dev - Update jetpack dependencies for syncing.
* Dev - Updates to account status logic to streamline it.
* Dev - Update subscriptions-core to 6.7.1.

= 7.0.0 - 2024-01-03 =
* Add - Add Account Management tools with reset account functionality for partially onboarded accounts.
* Add - Adding Compatibility Service to assist with flagging possible compatibility issues in the future.
Expand Down
1 change: 1 addition & 0 deletions client/checkout/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class WCPayAPI {
if ( ! this.stripe ) {
let betas = [ 'card_country_event_beta_1' ];
if ( isStripeLinkEnabled ) {
// https://stripe.com/docs/payments/link/autofill-modal
betas = betas.concat( [ 'link_autofill_modal_beta_1' ] );
}

Expand Down
20 changes: 20 additions & 0 deletions client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
} from '../constants.js';
import { getDeferredIntentCreationUPEFields } from './payment-elements';
import { handleWooPayEmailInput } from '../woopay/email-input-iframe';
import wcpayTracks from 'tracks';
import wooPayExpressCheckoutPaymentMethod from '../woopay/express-button/woopay-express-checkout-payment-method';
import { isPreviewing } from '../preview';

Expand Down Expand Up @@ -113,6 +114,24 @@ Object.entries( enabledPaymentMethodsConfig )
} );
} );

const addCheckoutTracking = () => {
const placeOrderButton = document.getElementsByClassName(
'wc-block-components-checkout-place-order-button'
);
if ( placeOrderButton.length ) {
placeOrderButton[ 0 ].addEventListener( 'click', () => {
const blocksCheckbox = document.getElementById(
'radio-control-wc-payment-method-options-woocommerce_payments'
);
if ( ! blocksCheckbox?.checked ) {
return;
}

wcpayTracks.recordUserEvent( wcpayTracks.events.PLACE_ORDER_CLICK );
} );
}
};

// Call handleWooPayEmailInput if woopay is enabled and this is the checkout page.
if ( getUPEConfig( 'isWooPayEnabled' ) ) {
if (
Expand All @@ -131,4 +150,5 @@ if ( getUPEConfig( 'isWooPayEnabled' ) ) {
registerExpressPaymentMethod( paymentRequestPaymentMethod( api ) );
window.addEventListener( 'load', () => {
enqueueFraudScripts( getUPEConfig( 'fraudServices' ) );
addCheckoutTracking();
} );
96 changes: 45 additions & 51 deletions client/checkout/blocks/payment-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import {
import enableStripeLinkPaymentMethod from 'wcpay/checkout/stripe-link';
import { getUPEConfig } from 'wcpay/utils/checkout';
import { validateElements } from 'wcpay/checkout/classic/payment-processing';
import {
BLOCKS_SHIPPING_ADDRESS_FIELDS,
BLOCKS_BILLING_ADDRESS_FIELDS,
} from '../constants';

const getBillingDetails = ( billingData ) => {
return {
Expand Down Expand Up @@ -74,66 +70,64 @@ const PaymentProcessor = ( {
const paymentMethodsConfig = getUPEConfig( 'paymentMethodsConfig' );
const isTestMode = getUPEConfig( 'testMode' );
const gatewayConfig = getPaymentMethods()[ upeMethods[ paymentMethodId ] ];
const customerData = useCustomerData();
const billingData = customerData.billingAddress;
const {
billingAddress: billingData,
setShippingAddress,
setBillingAddress,
} = useCustomerData();

useEffect( () => {
if ( isLinkEnabled( paymentMethodsConfig ) ) {
enableStripeLinkPaymentMethod( {
api: api,
elements: elements,
emailId: 'email',
fill_field_method: ( address, nodeId, key ) => {
const setAddress =
BLOCKS_SHIPPING_ADDRESS_FIELDS[ key ] === nodeId
? customerData.setShippingAddress
: customerData.setBillingData ||
customerData.setBillingAddress;
const customerAddress =
BLOCKS_SHIPPING_ADDRESS_FIELDS[ key ] === nodeId
? customerData.shippingAddress
: customerData.billingData ||
customerData.billingAddress;

if ( key === 'line1' ) {
customerAddress.address_1 = address.address[ key ];
} else if ( key === 'line2' ) {
customerAddress.address_2 = address.address[ key ];
} else if ( key === 'postal_code' ) {
customerAddress.postcode = address.address[ key ];
} else {
customerAddress[ key ] = address.address[ key ];
onAutofill: ( billingAddress, shippingAddress ) => {
// in some cases (e.g.: customer doesn't select the payment method in the Link modal), the billing address is empty.
if ( billingAddress ) {
// setting the country first, in case the "state"/"county"/"province"
// select changes from a select to a text field (or vice-versa).
setBillingAddress( {
country: billingAddress.country,
} );
// after the country, we can safely set the other fields
setBillingAddress( {
...billingAddress,
} );
}

setAddress( customerAddress );

if ( customerData.billingData ) {
customerData.billingData.email = getBlocksEmailValue();
customerData.setBillingData( customerData.billingData );
} else {
customerData.billingAddress.email = getBlocksEmailValue();
customerData.setBillingAddress(
customerData.billingAddress
);
// in some cases (e.g.: customer doesn't select the shipping address method in the Link modal),
// the shipping address is empty.
if ( shippingAddress ) {
// setting the country first, in case the "state"/"county"/"province"
// select changes from a select to a text field (or vice-versa).
setShippingAddress( {
country: shippingAddress.country,
} );
// after the country, we can safely set the other fields
setShippingAddress( {
...shippingAddress,
} );
}

// after all the above, we can now set the email field by getting its value from the DOM.
setBillingAddress( {
email: getBlocksEmailValue(),
} );
setShippingAddress( {
email: getBlocksEmailValue(),
} );
},
show_button: blocksShowLinkButtonHandler,
shipping_fields: BLOCKS_SHIPPING_ADDRESS_FIELDS,
billing_fields: BLOCKS_BILLING_ADDRESS_FIELDS,
complete_shipping: () => {
return (
document.getElementById( 'shipping-address_1' ) !== null
);
},
complete_billing: () => {
return (
document.getElementById( 'billing-address_1' ) !== null
);
},
onButtonShow: blocksShowLinkButtonHandler,
} );
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ elements ] );
}, [
api,
elements,
paymentMethodsConfig,
setBillingAddress,
setShippingAddress,
] );

useEffect(
() =>
Expand Down
Loading

0 comments on commit 047f334

Please sign in to comment.