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

Deprecate Sofort #7480

Merged
merged 19 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f957813
Removing Sofort from the WooPayments start Onboarding page.
dmallory42 Oct 13, 2023
13b69d9
Update changelog.
dmallory42 Oct 13, 2023
1e24d30
Adding PHP logic to prevent Sofort being passed to the Settings if it…
dmallory42 Oct 13, 2023
a2ec4eb
Adding Sofort notice on the Payments select list and payment disable …
dmallory42 Oct 16, 2023
65e0111
Merge branch 'develop' into dev/sofort-deprecation
dmallory42 Oct 16, 2023
5c4ff04
Update to use InlineNotice component instead of Notice.
dmallory42 Oct 17, 2023
c1f3b8f
Merge branch 'develop' into dev/sofort-deprecation
dmallory42 Oct 17, 2023
ece8d31
Merge branch 'dev/sofort-deprecation' of github.com:Automattic/woocom…
dmallory42 Oct 17, 2023
a73dba0
Update unit tests.
dmallory42 Oct 17, 2023
b5a944d
Remove remaining occurrence and update test snapshots
ismaeldcom Oct 17, 2023
99843b1
Removing code no longer needed after server update.
dmallory42 Oct 18, 2023
ddf113c
Merge branch 'dev/sofort-deprecation' of github.com:Automattic/woocom…
dmallory42 Oct 18, 2023
cb1f99d
Merge branch 'develop' into dev/sofort-deprecation
dmallory42 Oct 18, 2023
6493128
Update to unit tests.
dmallory42 Oct 18, 2023
5b035a2
Merge branch 'dev/sofort-deprecation' of github.com:Automattic/woocom…
dmallory42 Oct 18, 2023
4d0e8eb
Update the visual assets to remove Sofort.
dmallory42 Oct 19, 2023
5348010
Merge branch 'develop' into dev/sofort-deprecation
dmallory42 Oct 19, 2023
3993240
Remove unneeded comment.
dmallory42 Oct 19, 2023
6a94393
Merge branch 'dev/sofort-deprecation' of github.com:Automattic/woocom…
dmallory42 Oct 19, 2023
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
172 changes: 84 additions & 88 deletions assets/images/payment-methods/all_local_payments.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
183 changes: 92 additions & 91 deletions assets/images/payment-methods/local_payments.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 changelog/dev-sofort-deprecation
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Deprecate Sofort for any merchants who have not enabled it. Warn existing merchants about future deprecation.
19 changes: 14 additions & 5 deletions client/components/payment-methods-list/payment-method.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
.payment-method {
.payment-method__list-item {
display: flex;
flex-direction: column;
margin: 0;
padding: 24px;

&:not( :last-child ) {
box-shadow: inset 0 -1px 0 #e8eaeb;
}

& .sofort__notice {
margin-top: 20px;
}
}

.payment-method {
display: flex;
background: #fff;
justify-content: space-between;
align-items: center;
Expand All @@ -10,10 +23,6 @@
flex-wrap: nowrap;
}

&:not( :last-child ) {
box-shadow: inset 0 -1px 0 #e8eaeb;
}

&__text {
flex: 1 1 100%;
order: 1;
Expand Down
154 changes: 91 additions & 63 deletions client/components/payment-methods-list/payment-method.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Chip from '../chip';
import LoadableCheckboxControl from '../loadable-checkbox';
import { getDocumentationUrlForDisabledPaymentMethod } from '../payment-method-disabled-tooltip';
import Pill from '../pill';
import InlineNotice from '../inline-notice';
import './payment-method.scss';

interface PaymentMethodProps {
Expand Down Expand Up @@ -127,6 +128,8 @@ const PaymentMethod = ( {
upeCapabilityStatuses.PENDING_VERIFICATION,
].includes( status );

const shouldDisplayNotice = id === 'sofort';

const needsOverlay =
( isManualCaptureEnabled && ! isAllowingManualCapture ) ||
isSetupRequired ||
Expand Down Expand Up @@ -209,83 +212,108 @@ const PaymentMethod = ( {
return (
<li
className={ classNames(
'payment-method',
'payment-method__list-item',
{ 'has-icon-border': id !== 'card' },
{ overlay: needsOverlay },
className
) }
>
<div className="payment-method__checkbox">
<LoadableCheckboxControl
label={ label }
checked={ checked }
disabled={ disabled || locked }
onChange={ handleChange }
delayMsOnCheck={ 1500 }
delayMsOnUncheck={ 0 }
hideLabel
isAllowingManualCapture={ isAllowingManualCapture }
isSetupRequired={ isSetupRequired }
setupTooltip={ getTooltipContent( id ) as any }
needsAttention={ needsAttention }
/>
</div>
<div className="payment-method__text-container">
<div className="payment-method__icon">
<Icon />
</div>
<div className="payment-method__label payment-method__label-mobile">
<PaymentMethodLabel
<div className="payment-method">
<div className="payment-method__checkbox">
<LoadableCheckboxControl
label={ label }
required={ required }
status={ status }
disabled={ disabled }
checked={ checked }
disabled={ disabled || locked }
onChange={ handleChange }
delayMsOnCheck={ 1500 }
delayMsOnUncheck={ 0 }
hideLabel
isAllowingManualCapture={ isAllowingManualCapture }
isSetupRequired={ isSetupRequired }
setupTooltip={ getTooltipContent( id ) as any }
needsAttention={ needsAttention }
/>
</div>
<div className="payment-method__text">
<div className="payment-method__label-container">
<div className="payment-method__label payment-method__label-desktop">
<PaymentMethodLabel
label={ label }
required={ required }
status={ status }
disabled={ disabled }
/>
</div>
<div className="payment-method__description">
{ description }
</div>
<div className="payment-method__text-container">
<div className="payment-method__icon">
<Icon />
</div>
<div className="payment-method__label payment-method__label-mobile">
<PaymentMethodLabel
label={ label }
required={ required }
status={ status }
disabled={ disabled }
/>
</div>
{ accountFees && accountFees[ id ] && (
<div className="payment-method__fees">
<HoverTooltip
maxWidth={ '300px' }
content={ formatMethodFeesTooltip(
accountFees[ id ]
) }
>
<Pill
aria-label={ sprintf(
__(
'Base transaction fees: %s',
'woocommerce-payments'
),
formatMethodFeesDescription(
accountFees[ id ]
)
<div className="payment-method__text">
<div className="payment-method__label-container">
<div className="payment-method__label payment-method__label-desktop">
<PaymentMethodLabel
label={ label }
required={ required }
status={ status }
disabled={ disabled }
/>
</div>
<div className="payment-method__description">
{ description }
</div>
</div>
{ accountFees && accountFees[ id ] && (
<div className="payment-method__fees">
<HoverTooltip
maxWidth={ '300px' }
content={ formatMethodFeesTooltip(
accountFees[ id ]
) }
>
<span>
{ formatMethodFeesDescription(
accountFees[ id ]
<Pill
aria-label={ sprintf(
__(
'Base transaction fees: %s',
'woocommerce-payments'
),
formatMethodFeesDescription(
accountFees[ id ]
)
) }
</span>
</Pill>
</HoverTooltip>
</div>
) }
>
<span>
{ formatMethodFeesDescription(
accountFees[ id ]
) }
</span>
</Pill>
</HoverTooltip>
</div>
) }
</div>
</div>
</div>
{ shouldDisplayNotice && (
<InlineNotice
status="warning"
icon={ true }
isDismissible={ false }
className="sofort__notice"
>
<span>
{ __(
'Support for Sofort is ending soon. ',
'woocommerce-payments'
) }
<a
// eslint-disable-next-line max-len
href="https://woocommerce.com/document/woopayments/payment-methods/additional-payment-methods/#sofort-deprecation"
target="_blank"
rel="external noreferrer noopener"
>
{ __( 'Learn more', 'woocommerce-payments' ) }
</a>
</span>
</InlineNotice>
) }
</li>
);
};
Expand Down
2 changes: 0 additions & 2 deletions client/connect-account-page/payment-methods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import DinersClub from 'assets/images/cards/diners.svg?asset';
import GooglePay from 'assets/images/cards/google-pay.svg?asset';
import JCB from 'assets/images/cards/jcb.svg?asset';
import MasterCard from 'assets/images/cards/mastercard.svg?asset';
import Sofort from 'assets/images/payment-methods/sofort.svg?asset';
import UnionPay from 'assets/images/cards/unionpay.svg?asset';
import Visa from 'assets/images/cards/visa.svg?asset';
import WooPay from 'assets/images/payment-methods/woopay.svg?asset';
Expand All @@ -37,7 +36,6 @@ const PaymentMethods: React.FC = () => {
<img src={ DinersClub } alt="DinersClub" />
<img src={ UnionPay } alt="UnionPay" />
<img src={ JCB } alt="JCB" />
<img src={ Sofort } alt="Sofort" />
<img src={ Affirm } alt="Affirm" />
<img src={ AfterPay } alt="AfterPay" />
<span>& more.</span>
Expand Down
2 changes: 1 addition & 1 deletion client/connect-account-page/strings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
firstName ? ` ${ firstName }` : ''
),
usp1: __(
'Offer card payments, Apple Pay, Sofort, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.',
'Offer card payments, Apple Pay, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.',
'woocommerce-payments'
),
usp2: __(
Expand Down
18 changes: 3 additions & 15 deletions client/connect-account-page/test/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`ConnectAccountPage should render correctly 1`] = `
fill-rule="evenodd"
/>
</svg>
Offer card payments, Apple Pay, Sofort, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
Offer card payments, Apple Pay, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
<svg
class="gridicon gridicons-globe"
height="24"
Expand Down Expand Up @@ -148,10 +148,6 @@ exports[`ConnectAccountPage should render correctly 1`] = `
alt="JCB"
src="assets/images/cards/jcb.svg"
/>
<img
alt="Sofort"
src="assets/images/payment-methods/sofort.svg"
/>
<img
alt="Affirm"
src="assets/images/payment-methods/affirm.svg"
Expand Down Expand Up @@ -361,7 +357,7 @@ exports[`ConnectAccountPage should render correctly with WooPay eligible 1`] = `
fill-rule="evenodd"
/>
</svg>
Offer card payments, Apple Pay, Sofort, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
Offer card payments, Apple Pay, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
<svg
class="gridicon gridicons-globe"
height="24"
Expand Down Expand Up @@ -477,10 +473,6 @@ exports[`ConnectAccountPage should render correctly with WooPay eligible 1`] = `
alt="JCB"
src="assets/images/cards/jcb.svg"
/>
<img
alt="Sofort"
src="assets/images/payment-methods/sofort.svg"
/>
<img
alt="Affirm"
src="assets/images/payment-methods/affirm.svg"
Expand Down Expand Up @@ -652,7 +644,7 @@ exports[`ConnectAccountPage should render correctly with an incentive 1`] = `
fill-rule="evenodd"
/>
</svg>
Offer card payments, Apple Pay, Sofort, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
Offer card payments, Apple Pay, iDeal, Affirm, Afterpay, and accept in-person payments with the Woo mobile app.
<svg
class="gridicon gridicons-globe"
height="24"
Expand Down Expand Up @@ -756,10 +748,6 @@ exports[`ConnectAccountPage should render correctly with an incentive 1`] = `
alt="JCB"
src="assets/images/cards/jcb.svg"
/>
<img
alt="Sofort"
src="assets/images/payment-methods/sofort.svg"
/>
<img
alt="Affirm"
src="assets/images/payment-methods/affirm.svg"
Expand Down
28 changes: 27 additions & 1 deletion client/payment-methods/delete-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import interpolateComponents from '@automattic/interpolate-components';
*/
import PaymentDeleteIllustration from '../components/payment-delete-illustration';
import ConfirmationModal from '../components/confirmation-modal';
import InlineNotice from 'wcpay/components/inline-notice';

const ConfirmPaymentMethodDeleteModal: React.FunctionComponent< {
id: string;
Expand All @@ -20,6 +21,8 @@ const ConfirmPaymentMethodDeleteModal: React.FunctionComponent< {
onConfirm: () => void;
onCancel: () => void;
} > = ( { id, label, icon: Icon, onConfirm, onCancel } ): JSX.Element => {
const shouldDisplayNotice = id === 'sofort';

return (
<ConfirmationModal
title={ sprintf(
Expand Down Expand Up @@ -65,7 +68,7 @@ const ConfirmPaymentMethodDeleteModal: React.FunctionComponent< {
<p>
{ interpolateComponents( {
mixedString: __(
'You can add it again at any time in {{wooCommercePaymentsLink /}}',
'You can add it again at any time in {{wooCommercePaymentsLink /}}.',
'woocommerce-payments'
),
components: {
Expand All @@ -77,6 +80,29 @@ const ConfirmPaymentMethodDeleteModal: React.FunctionComponent< {
},
} ) }
</p>
{ shouldDisplayNotice && (
<InlineNotice
status="warning"
icon={ true }
isDismissible={ false }
className="sofort__notice"
>
<span>
{ __(
'As of October 20th 2023, Sofort is no longer supported for merchants who are not already using it. This means that if you disable Sofort, you will not be able to re-enable it later. ',
'woocommerce-payments'
) }
<a
// eslint-disable-next-line max-len
href="https://woocommerce.com/document/woopayments/payment-methods/additional-payment-methods/#sofort-deprecation"
target="_blank"
rel="external noreferrer noopener"
>
{ __( 'Learn more', 'woocommerce-payments' ) }
</a>
</span>
</InlineNotice>
) }
</ConfirmationModal>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ exports[`Activation Modal matches the snapshot 1`] = `
>
WooPayments
</a>
.
</p>
<hr
class="wcpay-confirmation-modal__separator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ public function validate_business_support_address( array $value, WP_REST_Request
* @return WP_REST_Response
*/
public function get_settings(): WP_REST_Response {
$wcpay_form_fields = $this->wcpay_gateway->get_form_fields();
$wcpay_form_fields = $this->wcpay_gateway->get_form_fields();

$available_upe_payment_methods = $this->wcpay_gateway->get_upe_available_payment_methods();

/**
* It might be possible that enabled payment methods settings have an invalid state. As an example,
* if an account is switched to a new country and earlier country had PM's that are no longer valid; or if the PM is not available anymore.
Expand Down
Loading