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 7.2.0 #8174

Merged
merged 53 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f2ace16
Address QIT security errors (#8060)
mgascam Jan 23, 2024
3b1c603
chore: remove unused generate_* functions (#8072)
frosso Jan 23, 2024
48e3d72
chore: comment on internal methods called by WC core (#8077)
frosso Jan 23, 2024
623acb8
Updating to modern Woo colours (#7837)
brentmackinnon Jan 23, 2024
a30b1ac
Revert "Revert "Displaying Clearpay instead of Afterpay for UK based …
gpressutto5 Jan 23, 2024
2f2fa96
Add blog ID validation to WooPay session (#8045)
rafaelzaleski Jan 23, 2024
e9e5be3
Update confetti animation (#8083)
ismaeldcom Jan 24, 2024
fbecab2
Add E2E tests for merchant on-boarding (#7955)
rafaelzaleski Jan 24, 2024
44ab94f
Prevent Coupon Usage Increase in a Woopay Preflight Check (#8065)
lovo-h Jan 24, 2024
3cae215
remove unnecessary tracks events for acceptDispute submit success/fai…
haszari Jan 25, 2024
0e7fda9
chore: remove unused customGatewayTitle (#8071)
frosso Jan 25, 2024
ff86d88
chore: remove unused checkout API functions (#8081)
frosso Jan 25, 2024
6a6af30
chore: remove deprecated functions since 5.0.0 (#8073)
frosso Jan 25, 2024
67b42fb
Merge trunk v7.1.0 into develop
botwoo Jan 25, 2024
3e13b1d
fix: pay-for-order compatibility with other gateways (#8089)
frosso Jan 25, 2024
e2a1732
Update deposits REST API docs with decoupled deposit changes (#7848)
Jinksi Jan 25, 2024
6f0f602
Remove redundant estimated deposit code (#8057)
Jinksi Jan 25, 2024
33cdb7d
Refactor: Consolidate Express Checkout Methods into Single Helper Cla…
mdmoore Jan 26, 2024
80087f9
Don't instantiate `Fraud_Prevention_Service` in checkout if processin…
ricardo Jan 26, 2024
edf69a5
WooPay Direct Checkout (#7890)
lovo-h Jan 29, 2024
c4f63db
Add compatibility data when onboarding (#7990)
jessepearson Jan 31, 2024
be4a007
Fix losing cart contents during the login at checkout (#8084)
htdat Feb 1, 2024
aafd4bf
chore: remove isOrderPage return value (#8091)
frosso Feb 1, 2024
e151595
chore: remove unused gateway class methods (#8078)
frosso Feb 1, 2024
08cf462
Filtering APMs by billing country (#8082)
gpressutto5 Feb 1, 2024
a9bba5b
Added ENUM class for currency codes (#7997)
naman03malhotra Feb 2, 2024
fb434b8
Standardise Tracking Calls on the Client (#8106)
dmallory42 Feb 2, 2024
04d25ad
Update WPORG plugin title (#8115)
vladolaru Feb 2, 2024
1a67e84
Bump qit-cli dependency to version 0.4.0 (#8114)
allie500 Feb 2, 2024
9ea9224
Expose charge id so merchant can use it to submit duplicate dispute e…
shendy-a8c Feb 3, 2024
322d3d8
Add Stripe Link support for 3DS payments (#8119)
timur27 Feb 5, 2024
aa1e97d
Remove Woo plugin header (#8050)
vbelolapotkov Feb 5, 2024
7448731
Showing "started" event in transaction timeline (#8126)
gpressutto5 Feb 5, 2024
02194d1
Fix E2E shopper tests around 3DS and UPE settings (#8123)
bborman22 Feb 5, 2024
37ef892
Render a notice when the available balance is below the minimum depos…
Jinksi Feb 5, 2024
bcbb2eb
Fixes Pay for Order page for non-card payment methods (#8111)
FangedParakeet Feb 6, 2024
f911d30
Negative balance deposit notice will only show when total balance is …
brucealdridge Feb 7, 2024
f5a43db
fix: help text alignemnt with Gutenberg plugin (#8147)
frosso Feb 7, 2024
f31da34
Bump WC tested up to version to 8.5.2 (#8124)
allie500 Feb 7, 2024
204f395
Refactor the Woopay Checkout Flow UX (#8133)
rafaelzaleski Feb 7, 2024
4a3011c
Prevent WooPay webhook creation attempt when account is suspended (#8…
malithsen Feb 8, 2024
dcff735
Format fee descriptions for iDeal payment method without percentage r…
KarlisJ Feb 8, 2024
ef934b7
Apply localization to CSV exports sent via email. (#7938)
mordeth Feb 8, 2024
fa5925a
Displaying the correct method name in Order Edit page for HPOS (#8150)
gpressutto5 Feb 8, 2024
4707df6
Skip the log file life extension unit test on WC after v8.6.0 (#8159)
james-allan Feb 9, 2024
9bfa935
New Tracking events and passing more tracking parameters (#8127)
dmallory42 Feb 9, 2024
2d16b99
Fix WooPayments overriding a WooCommerce analytics style (#8153)
ismaeldcom Feb 9, 2024
7b46387
Using Event Type and string literals for events (#8166)
dmallory42 Feb 9, 2024
939a2e5
Track Source in the onboarding flow start event (#8165)
oaratovskyi Feb 9, 2024
8512583
Update Tracks conditions (#8161)
malithsen Feb 10, 2024
56beb9f
Update version and add changelog entries for release 7.2.0
github-actions[bot] Feb 11, 2024
e0781ad
Update CSV export language codes to align with the languages supporte…
mordeth Feb 14, 2024
d3f9684
Amend changelog entries for release 7.2.0
botwoo Feb 14, 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
1 change: 1 addition & 0 deletions .github/actions/e2e/run-log-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ runs:
with:
name: wp(${{ env.E2E_WP_VERSION }})-wc(${{ env.E2E_WC_VERSION }})-${{ env.E2E_GROUP }}-${{ env.E2E_BRANCH }}
path: |
screenshots
tests/e2e/screenshots
tests/e2e/docker/wordpress/wp-content/debug.log
${{ env.E2E_RESULT_FILEPATH }}
Expand Down
5 changes: 0 additions & 5 deletions assets/images/payment-methods/afterpay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions assets/images/payment-methods/clearpay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
*** WooPayments Changelog ***

= 7.2.0 - 2024-02-14 =
* Add - Add compatibility data to onboarding init payload.
* Add - Add WooPay direct checkout flow behind a feature flag.
* Add - Apply localization to CSV exports for transactions, deposits, and disputes sent via email.
* Add - Displaying Clearpay instead of Afterpay for UK based stores
* Add - Enhance WooPay session validation
* Add - Filtering APMs by billing country
* Add - Show a notice to the merchant when the available balance is below the minimum deposit amount.
* Add - Show charge id on payments details page, so merchants can grab it to fill out the dispute evidence form when needed.
* Add - Showing "started" event in transaction timeline
* Add - Support Stripe Link payments with 3DS cards.
* Fix - Adjust WordPress locale code to match the languages supported by the server.
* Fix - Displaying the correct method name in Order Edit page for HPOS
* Fix - Don't instantiate `Fraud_Prevention_Service` in checkout if processing an authorized WooPay request.
* Fix - fix: help text alignment with Gutenberg plugin enabled
* Fix - fix: pay-for-order compatibility with other gateways
* Fix - Fixed a bug where the 'deposits paused while balance is negative' notice was erroneously shown after an instant deposit.
* Fix - Fixes Pay for Order checkout using non-card payment methods.
* Fix - Fix losing cart contents during the login at checkout.
* Fix - Merge duplicated Payment Request and WooPay button functionality .
* Fix - Prevent coupon usage increase in a WooPay preflight check.
* Fix - Prevent WooPay webhook creation when account is suspended
* Update - Add source to the onboarding flow page and track it
* Update - Refactor the WooPay checkout flow UX
* Update - Some minor update to tracking parameters to pass additional data like Woo store ID.
* Update - Stop relying on Woo core for loading plugin translations.
* Dev - Added ENUM class for currency codes
* Dev - Bump WC tested up to version to 8.5.2.
* Dev - chore: removed deprecated functions since 5.0.0
* Dev - chore: remove unused checkout API methods
* Dev - chore: remove unused gateway class methods
* Dev - chore: remove unused isOrderPage return value from confirmIntent
* Dev - chore: update colors on documentation pages
* Dev - Comment: Bump qit-cli dependency to version 0.4.0.
* Dev - E2E test - Merchant facing multi-currency on-boarding screen.
* Dev - Fix for E2E shopper tests around 3DS and UPE settings
* Dev - Refactoring the tracking logic
* Dev - Refactor to how tracking events are defined for better readability.
* Dev - Remove unnecessary tracks events for dispute accept success/error.
* Dev - Update REST API documentation for deposits endpoints with changes to estimated and instant deposits
* Dev - Update Tracks conditions

= 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.
Expand Down
22 changes: 8 additions & 14 deletions client/card-readers/settings/file-upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* External dependencies
*/
import React from 'react';
import wcpayTracks from 'tracks';
import { recordEvent } from 'tracks';
import apiFetch from '@wordpress/api-fetch';
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
Expand Down Expand Up @@ -71,12 +71,9 @@ const BrandingFileUpload: React.FunctionComponent< CardReaderFileUploadProps > =

setLoading( true );

wcpayTracks.recordEvent(
'wcpay_merchant_settings_file_upload_started',
{
type: key,
}
);
recordEvent( 'wcpay_merchant_settings_file_upload_started', {
type: key,
} );

const body = new FormData();
body.append( 'file', file );
Expand All @@ -99,14 +96,11 @@ const BrandingFileUpload: React.FunctionComponent< CardReaderFileUploadProps > =
setLoading( false );
setUploadError( false );

wcpayTracks.recordEvent(
'wcpay_merchant_settings_file_upload_success',
{
type: key,
}
);
recordEvent( 'wcpay_merchant_settings_file_upload_success', {
type: key,
} );
} catch ( { err } ) {
wcpayTracks.recordEvent( 'wcpay_merchant_settings_upload_failed', {
recordEvent( 'wcpay_merchant_settings_file_upload_success', {
message: ( err as Error ).message,
} );

Expand Down
156 changes: 53 additions & 103 deletions client/checkout/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default class WCPayAPI {
*
* @param {string} redirectUrl The redirect URL, returned from the server.
* @param {string} paymentMethodToSave The ID of a Payment Method if it should be saved (optional).
* @return {mixed} A redirect URL on success, or `true` if no confirmation is needed.
* @return {Promise<string>|boolean} A redirect URL on success, or `true` if no confirmation is needed.
*/
confirmIntent( redirectUrl, paymentMethodToSave ) {
const partials = redirectUrl.match(
Expand Down Expand Up @@ -252,9 +252,9 @@ export default class WCPayAPI {
// If this is a setup intent we're not processing a woopay payment so we can
// use the regular getStripe function.
if ( isSetupIntent ) {
return this.getStripe().confirmCardSetup(
decryptClientSecret( clientSecret )
);
return this.getStripe().handleNextAction( {
clientSecret: decryptClientSecret( clientSecret ),
} );
}

// For woopay we need the capability to switch up the account ID specifically for
Expand All @@ -274,66 +274,61 @@ export default class WCPayAPI {

// When not dealing with a setup intent or woopay we need to force an account
// specific request in Stripe.
return this.getStripe( true ).confirmCardPayment(
decryptClientSecret( clientSecret )
);
return this.getStripe( true ).handleNextAction( {
clientSecret: decryptClientSecret( clientSecret ),
} );
};

const confirmAction = confirmPaymentOrSetup();

const request = confirmAction
// ToDo: Switch to an async function once it works with webpack.
.then( ( result ) => {
const intentId =
( result.paymentIntent && result.paymentIntent.id ) ||
( result.setupIntent && result.setupIntent.id ) ||
( result.error &&
result.error.payment_intent &&
result.error.payment_intent.id ) ||
( result.error.setup_intent &&
result.error.setup_intent.id );

// In case this is being called via payment request button from a product page,
// the getConfig function won't work, so fallback to getPaymentRequestData.
const ajaxUrl =
getPaymentRequestData( 'ajax_url' ) ??
getConfig( 'ajaxUrl' );

const ajaxCall = this.request( ajaxUrl, {
action: 'update_order_status',
order_id: orderId,
// Update the current order status nonce with the new one to ensure that the update
// order status call works when a guest user creates an account during checkout.
_ajax_nonce: nonce,
intent_id: intentId,
payment_method_id: paymentMethodToSave || null,
} );

return [ ajaxCall, result.error ];
} )
.then( ( [ verificationCall, originalError ] ) => {
if ( originalError ) {
throw originalError;
}

return verificationCall.then( ( response ) => {
const result =
typeof response === 'string'
? JSON.parse( response )
: response;
return (
confirmPaymentOrSetup()
// ToDo: Switch to an async function once it works with webpack.
.then( ( result ) => {
const intentId =
( result.paymentIntent && result.paymentIntent.id ) ||
( result.setupIntent && result.setupIntent.id ) ||
( result.error &&
result.error.payment_intent &&
result.error.payment_intent.id ) ||
( result.error.setup_intent &&
result.error.setup_intent.id );

// In case this is being called via payment request button from a product page,
// the getConfig function won't work, so fallback to getPaymentRequestData.
const ajaxUrl =
getPaymentRequestData( 'ajax_url' ) ??
getConfig( 'ajaxUrl' );

const ajaxCall = this.request( ajaxUrl, {
action: 'update_order_status',
order_id: orderId,
// Update the current order status nonce with the new one to ensure that the update
// order status call works when a guest user creates an account during checkout.
_ajax_nonce: nonce,
intent_id: intentId,
payment_method_id: paymentMethodToSave || null,
} );

if ( result.error ) {
throw result.error;
return [ ajaxCall, result.error ];
} )
.then( ( [ verificationCall, originalError ] ) => {
if ( originalError ) {
throw originalError;
}

return result.return_url;
} );
} );
return verificationCall.then( ( response ) => {
const result =
typeof response === 'string'
? JSON.parse( response )
: response;

return {
request,
isOrderPage,
};
if ( result.error ) {
throw result.error;
}

return result.return_url;
} );
} )
);
}

/**
Expand Down Expand Up @@ -565,49 +560,4 @@ export default class WCPayAPI {
...paymentData,
} );
}

/**
* Log Payment Errors via Ajax.
*
* @param {string} chargeId Stripe Charge ID
* @return {boolean} Returns true irrespective of result.
*/
logPaymentError( chargeId ) {
return this.request(
buildAjaxURL( getConfig( 'wcAjaxUrl' ), 'log_payment_error' ),
{
charge_id: chargeId,
_ajax_nonce: getConfig( 'logPaymentErrorNonce' ),
}
).then( () => {
// There is not any action to take or harm caused by a failed update, so just returning true.
return true;
} );
}

/**
* Redirect to the order-received page for duplicate payments.
*
* @param {Object} response Response data to check if doing the redirect.
* @return {boolean} Returns true if doing the redirection.
*/
handleDuplicatePayments( {
wcpay_upe_paid_for_previous_order: previouslyPaid,
wcpay_upe_previous_successful_intent: previousSuccessfulIntent,
redirect,
} ) {
if ( redirect ) {
// Another order has the same cart content and was paid.
if ( previouslyPaid ) {
return ( window.location = redirect );
}

// Another intent has the equivalent successful status for the order.
if ( previousSuccessfulIntent ) {
return ( window.location = redirect );
}
}

return false;
}
}
10 changes: 3 additions & 7 deletions client/checkout/blocks/confirm-card-payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,22 @@ export default async function confirmCardPayment(
const { redirect, payment_method: paymentMethod } = paymentDetails;

try {
const confirmation = api.confirmIntent(
const confirmationRequest = api.confirmIntent(
redirect,
shouldSavePayment ? paymentMethod : null
);

// `true` means there is no intent to confirm.
if ( confirmation === true ) {
if ( confirmationRequest === true ) {
return {
type: 'success',
redirectUrl: redirect,
};
}

// `confirmIntent` also returns `isOrderPage`, but that's not supported in blocks yet.
const { request } = confirmation;

const finalRedirect = await request;
return {
type: 'success',
redirectUrl: finalRedirect,
redirectUrl: await confirmationRequest,
};
} catch ( error ) {
return {
Expand Down
4 changes: 2 additions & 2 deletions client/checkout/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from '../constants.js';
import { getDeferredIntentCreationUPEFields } from './payment-elements';
import { handleWooPayEmailInput } from '../woopay/email-input-iframe';
import wcpayTracks from 'tracks';
import { recordUserEvent } from 'tracks';
import wooPayExpressCheckoutPaymentMethod from '../woopay/express-button/woopay-express-checkout-payment-method';
import { isPreviewing } from '../preview';

Expand Down Expand Up @@ -127,7 +127,7 @@ const addCheckoutTracking = () => {
return;
}

wcpayTracks.recordUserEvent( wcpayTracks.events.PLACE_ORDER_CLICK );
recordUserEvent( 'checkout_place_order_button_click' );
} );
}
};
Expand Down
7 changes: 3 additions & 4 deletions client/checkout/classic/3ds-flow-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ export const showAuthenticationModalIfRequired = ( api ) => {
const paymentMethodId = document.querySelector( '#wcpay-payment-method' )
?.value;

const confirmation = api.confirmIntent(
const confirmationRequest = api.confirmIntent(
window.location.href,
shouldSavePaymentPaymentMethod() ? paymentMethodId : null
);

// Boolean `true` means that there is nothing to confirm.
if ( confirmation === true ) {
if ( confirmationRequest === true ) {
return Promise.resolve();
}

const { request } = confirmation;
cleanupURL();

return request
return confirmationRequest
.then( ( redirectUrl ) => {
window.location = redirectUrl;
} )
Expand Down
Loading
Loading