From 531df4e64d18d715a845e5d9fd2c5d604985cf05 Mon Sep 17 00:00:00 2001 From: Daniel Mallory Date: Thu, 19 Oct 2023 14:41:37 +0100 Subject: [PATCH] Deprecate Sofort (#7480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ismael Martín Alabarce --- .../payment-methods/all_local_payments.svg | 172 ++++++++-------- .../images/payment-methods/local_payments.svg | 183 +++++++++--------- changelog/dev-sofort-deprecation | 4 + .../payment-methods-list/payment-method.scss | 19 +- .../payment-methods-list/payment-method.tsx | 154 +++++++++------ .../connect-account-page/payment-methods.tsx | 2 - client/connect-account-page/strings.tsx | 2 +- .../test/__snapshots__/index.test.tsx.snap | 18 +- client/payment-methods/delete-modal.tsx | 28 ++- .../__snapshots__/delete-modal.test.js.snap | 1 + ...s-wc-rest-payments-settings-controller.php | 4 +- 11 files changed, 320 insertions(+), 267 deletions(-) create mode 100644 changelog/dev-sofort-deprecation diff --git a/assets/images/payment-methods/all_local_payments.svg b/assets/images/payment-methods/all_local_payments.svg index 94f1b2ff2ad..c9a0b2fbd4e 100644 --- a/assets/images/payment-methods/all_local_payments.svg +++ b/assets/images/payment-methods/all_local_payments.svg @@ -1,142 +1,138 @@ - - - - - - - + + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + - + - - + + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - - - - - + + - - + + - - + + - - + + diff --git a/assets/images/payment-methods/local_payments.svg b/assets/images/payment-methods/local_payments.svg index 4b1d690585b..67ff6345025 100644 --- a/assets/images/payment-methods/local_payments.svg +++ b/assets/images/payment-methods/local_payments.svg @@ -1,92 +1,93 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/changelog/dev-sofort-deprecation b/changelog/dev-sofort-deprecation new file mode 100644 index 00000000000..1eafc616f0b --- /dev/null +++ b/changelog/dev-sofort-deprecation @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Deprecate Sofort for any merchants who have not enabled it. Warn existing merchants about future deprecation. diff --git a/client/components/payment-methods-list/payment-method.scss b/client/components/payment-methods-list/payment-method.scss index c00b22fd91a..ae75df340a3 100644 --- a/client/components/payment-methods-list/payment-method.scss +++ b/client/components/payment-methods-list/payment-method.scss @@ -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; @@ -10,10 +23,6 @@ flex-wrap: nowrap; } - &:not( :last-child ) { - box-shadow: inset 0 -1px 0 #e8eaeb; - } - &__text { flex: 1 1 100%; order: 1; diff --git a/client/components/payment-methods-list/payment-method.tsx b/client/components/payment-methods-list/payment-method.tsx index 28385de1ad7..7f5bb405f37 100644 --- a/client/components/payment-methods-list/payment-method.tsx +++ b/client/components/payment-methods-list/payment-method.tsx @@ -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 { @@ -127,6 +128,8 @@ const PaymentMethod = ( { upeCapabilityStatuses.PENDING_VERIFICATION, ].includes( status ); + const shouldDisplayNotice = id === 'sofort'; + const needsOverlay = ( isManualCaptureEnabled && ! isAllowingManualCapture ) || isSetupRequired || @@ -209,83 +212,108 @@ const PaymentMethod = ( { return (
  • -
    - -
    -
    -
    - -
    -
    - +
    +
    -
    -
    -
    - -
    -
    - { description } -
    +
    +
    + +
    +
    +
    - { accountFees && accountFees[ id ] && ( -
    - - +
    +
    + +
    +
    + { description } +
    +
    + { accountFees && accountFees[ id ] && ( +
    + - - { formatMethodFeesDescription( - accountFees[ id ] + - - -
    - ) } + > + + { formatMethodFeesDescription( + accountFees[ id ] + ) } + +
    +
    +
    + ) } +
    + { shouldDisplayNotice && ( + + + { __( + 'Support for Sofort is ending soon. ', + 'woocommerce-payments' + ) } + + { __( 'Learn more', 'woocommerce-payments' ) } + + + + ) }
  • ); }; diff --git a/client/connect-account-page/payment-methods.tsx b/client/connect-account-page/payment-methods.tsx index 6279e9217a5..12c7e9ac3ab 100644 --- a/client/connect-account-page/payment-methods.tsx +++ b/client/connect-account-page/payment-methods.tsx @@ -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'; @@ -37,7 +36,6 @@ const PaymentMethods: React.FC = () => { DinersClub UnionPay JCB - Sofort Affirm AfterPay & more. diff --git a/client/connect-account-page/strings.tsx b/client/connect-account-page/strings.tsx index 253da597433..08c4aab5aee 100644 --- a/client/connect-account-page/strings.tsx +++ b/client/connect-account-page/strings.tsx @@ -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: __( diff --git a/client/connect-account-page/test/__snapshots__/index.test.tsx.snap b/client/connect-account-page/test/__snapshots__/index.test.tsx.snap index e3a29ca11ad..188d8dd52ee 100644 --- a/client/connect-account-page/test/__snapshots__/index.test.tsx.snap +++ b/client/connect-account-page/test/__snapshots__/index.test.tsx.snap @@ -44,7 +44,7 @@ exports[`ConnectAccountPage should render correctly 1`] = ` fill-rule="evenodd" /> - 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. - Sofort Affirm - 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. - Sofort Affirm - 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. - Sofort Affirm void; onCancel: () => void; } > = ( { id, label, icon: Icon, onConfirm, onCancel } ): JSX.Element => { + const shouldDisplayNotice = id === 'sofort'; + return ( { 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: { @@ -77,6 +80,29 @@ const ConfirmPaymentMethodDeleteModal: React.FunctionComponent< { }, } ) }

    + { shouldDisplayNotice && ( + + + { __( + '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' + ) } + + { __( 'Learn more', 'woocommerce-payments' ) } + + + + ) }
    ); }; diff --git a/client/payment-methods/test/__snapshots__/delete-modal.test.js.snap b/client/payment-methods/test/__snapshots__/delete-modal.test.js.snap index 874e41c0ed6..0af44bf73a1 100644 --- a/client/payment-methods/test/__snapshots__/delete-modal.test.js.snap +++ b/client/payment-methods/test/__snapshots__/delete-modal.test.js.snap @@ -117,6 +117,7 @@ exports[`Activation Modal matches the snapshot 1`] = ` > WooPayments + .


    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.