Skip to content

Commit 877242c

Browse files
FangedParakeetgpressutto5brettshumaker
authored
Removes Sofort from settings and checkout (#9820)
Co-authored-by: Guilherme Pressutto <gpressutto5@gmail.com> Co-authored-by: Brett Shumaker <brettshumaker@gmail.com>
1 parent 79f96a0 commit 877242c

File tree

15 files changed

+73
-151
lines changed

15 files changed

+73
-151
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: update
3+
4+
Removes Sofort payment method from settings and checkout, permanently deprecates Sofort from settings.

client/additional-methods-setup/upe-preview-methods-selector/test/add-payment-methods-task.test.js

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,9 @@ describe( 'AddPaymentMethodsTask', () => {
6666
'card',
6767
'bancontact',
6868
'eps',
69-
'giropay',
7069
'ideal',
7170
'p24',
7271
'sepa_debit',
73-
'sofort',
7472
] );
7573
useGetPaymentMethodStatuses.mockReturnValue( {
7674
card_payments: {
@@ -85,10 +83,6 @@ describe( 'AddPaymentMethodsTask', () => {
8583
status: upeCapabilityStatuses.ACTIVE,
8684
requirements: [],
8785
},
88-
giropay_payments: {
89-
status: upeCapabilityStatuses.ACTIVE,
90-
requirements: [],
91-
},
9286
ideal_payments: {
9387
status: upeCapabilityStatuses.ACTIVE,
9488
requirements: [],
@@ -101,10 +95,6 @@ describe( 'AddPaymentMethodsTask', () => {
10195
status: upeCapabilityStatuses.ACTIVE,
10296
requirements: [],
10397
},
104-
sofort_payments: {
105-
status: upeCapabilityStatuses.ACTIVE,
106-
requirements: [],
107-
},
10898
} );
10999
useSettings.mockReturnValue( {
110100
saveSettings: () => Promise.resolve( true ),
@@ -186,11 +176,9 @@ describe( 'AddPaymentMethodsTask', () => {
186176
const expectedToBeUnchecked = [
187177
'Bancontact',
188178
'EPS',
189-
'giropay',
190179
'iDEAL',
191180
'Przelewy24 (P24)',
192181
'SEPA Direct Debit',
193-
'Sofort',
194182
];
195183

196184
expectedToBeUnchecked.forEach( function ( checkboxName ) {
@@ -243,11 +231,9 @@ describe( 'AddPaymentMethodsTask', () => {
243231
const expectedToBeUnchecked = [
244232
'Bancontact',
245233
'EPS',
246-
'giropay',
247234
'iDEAL',
248235
'Przelewy24 (P24)',
249236
'SEPA Direct Debit',
250-
'Sofort',
251237
];
252238

253239
expectedToBeUnchecked.forEach( function ( checkboxName ) {
@@ -294,15 +280,7 @@ describe( 'AddPaymentMethodsTask', () => {
294280
it( 'should remove the un-checked payment methods, if they were present before', async () => {
295281
const setCompletedMock = jest.fn();
296282
const updateEnabledPaymentMethodsMock = jest.fn();
297-
const initialMethods = [
298-
'card',
299-
'bancontact',
300-
'eps',
301-
'giropay',
302-
'p24',
303-
'ideal',
304-
'sofort',
305-
];
283+
const initialMethods = [ 'card', 'bancontact', 'eps', 'p24', 'ideal' ];
306284
useEnabledPaymentMethodIds.mockReturnValue( [
307285
initialMethods,
308286
updateEnabledPaymentMethodsMock,
@@ -321,11 +299,9 @@ describe( 'AddPaymentMethodsTask', () => {
321299
const expectedToBeUnchecked = [
322300
'Bancontact',
323301
'EPS',
324-
'giropay',
325302
'iDEAL',
326303
'Przelewy24 (P24)',
327304
'SEPA Direct Debit',
328-
'Sofort',
329305
];
330306

331307
expectedToBeUnchecked.forEach( function ( checkboxName ) {
@@ -335,7 +311,7 @@ describe( 'AddPaymentMethodsTask', () => {
335311
jest.useFakeTimers();
336312
// Uncheck methods.
337313
act( () => {
338-
const methodsToCheck = [ 'Bancontact', 'giropay' ];
314+
const methodsToCheck = [ 'Bancontact', 'iDEAL' ];
339315
methodsToCheck.forEach( function ( checkboxName ) {
340316
userEvent.click( screen.getByLabelText( checkboxName ) );
341317
jest.runOnlyPendingTimers();
@@ -350,7 +326,7 @@ describe( 'AddPaymentMethodsTask', () => {
350326
expect( updateEnabledPaymentMethodsMock ).toHaveBeenCalledWith( [
351327
'card',
352328
'bancontact',
353-
'giropay',
329+
'ideal',
354330
] );
355331
await waitFor( () =>
356332
expect( setCompletedMock ).toHaveBeenCalledWith(
@@ -376,10 +352,6 @@ describe( 'AddPaymentMethodsTask', () => {
376352
status: upeCapabilityStatuses.ACTIVE,
377353
requirements: [],
378354
},
379-
giropay_payments: {
380-
status: upeCapabilityStatuses.PENDING_APPROVAL,
381-
requirements: [],
382-
},
383355
ideal_payments: {
384356
status: upeCapabilityStatuses.ACTIVE,
385357
requirements: [],
@@ -392,10 +364,6 @@ describe( 'AddPaymentMethodsTask', () => {
392364
status: upeCapabilityStatuses.PENDING_VERIFICATION,
393365
requirements: [],
394366
},
395-
sofort_payments: {
396-
status: upeCapabilityStatuses.ACTIVE,
397-
requirements: [],
398-
},
399367
} );
400368

401369
render(
@@ -422,9 +390,9 @@ describe( 'AddPaymentMethodsTask', () => {
422390
it( 'should render the activation modal when requirements exist for the payment method', () => {
423391
const setCompletedMock = jest.fn();
424392
useEnabledPaymentMethodIds.mockReturnValue( [ [ 'card' ], jest.fn() ] );
425-
useGetAvailablePaymentMethodIds.mockReturnValue( [ 'sofort' ] );
393+
useGetAvailablePaymentMethodIds.mockReturnValue( [ 'ideal' ] );
426394
useGetPaymentMethodStatuses.mockReturnValue( {
427-
sofort_payments: {
395+
ideal_payments: {
428396
status: upeCapabilityStatuses.UNREQUESTED,
429397
requirements: [ 'company.tax_id' ],
430398
},
@@ -440,9 +408,9 @@ describe( 'AddPaymentMethodsTask', () => {
440408
</SettingsContextProvider>
441409
);
442410

443-
expect( screen.queryByLabelText( 'Sofort' ) ).toBeInTheDocument();
411+
expect( screen.queryByLabelText( 'iDEAL' ) ).toBeInTheDocument();
444412

445-
const cardCheckbox = screen.getByLabelText( 'Sofort' );
413+
const cardCheckbox = screen.getByLabelText( 'iDEAL' );
446414

447415
expect( cardCheckbox ).not.toBeChecked();
448416

@@ -456,7 +424,7 @@ describe( 'AddPaymentMethodsTask', () => {
456424

457425
expect(
458426
screen.queryByText(
459-
/You need to provide more information to enable Sofort on your checkout/
427+
/You need to provide more information to enable iDEAL on your checkout/
460428
)
461429
).toBeInTheDocument();
462430

client/additional-methods-setup/upe-preview-methods-selector/test/currency-information-for-methods.test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ describe( 'CurrencyInformationForMethods', () => {
6565
'card',
6666
'bancontact',
6767
'eps',
68-
'giropay',
6968
'ideal',
7069
'p24',
71-
'sofort',
7270
'sepa_debit',
7371
] }
7472
/>
@@ -89,10 +87,8 @@ describe( 'CurrencyInformationForMethods', () => {
8987
'card',
9088
'bancontact',
9189
'eps',
92-
'giropay',
9390
'ideal',
9491
'p24',
95-
'sofort',
9692
'sepa_debit',
9793
] }
9894
/>
@@ -120,10 +116,8 @@ describe( 'CurrencyInformationForMethods', () => {
120116
'card',
121117
'bancontact',
122118
'eps',
123-
'giropay',
124119
'ideal',
125120
'p24',
126-
'sofort',
127121
'sepa_debit',
128122
] }
129123
/>

client/additional-methods-setup/upe-preview-methods-selector/test/setup-complete-task.test.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,7 @@ jest.mock( '../../../data', () => ( {
2121
describe( 'SetupComplete', () => {
2222
beforeEach( () => {
2323
useEnabledPaymentMethodIds.mockReturnValue( [
24-
[
25-
'card',
26-
'bancontact',
27-
'eps',
28-
'giropay',
29-
'sofort',
30-
'ideal',
31-
'p24',
32-
'sepa_debit',
33-
],
24+
[ 'card', 'bancontact', 'eps', 'ideal', 'p24', 'sepa_debit' ],
3425
() => null,
3526
] );
3627
} );
@@ -75,10 +66,8 @@ describe( 'SetupComplete', () => {
7566
'card',
7667
'bancontact',
7768
'eps',
78-
'giropay',
7969
'ideal',
8070
'p24',
81-
'sofort',
8271
'sepa_debit',
8372
],
8473
},
@@ -98,7 +87,7 @@ describe( 'SetupComplete', () => {
9887

9988
it( 'renders setup complete messaging when context value says that one payment method has been removed', () => {
10089
useEnabledPaymentMethodIds.mockReturnValue( [
101-
[ 'card', 'sofort' ],
90+
[ 'card', 'ideal' ],
10291
() => null,
10392
] );
10493
render(
@@ -110,10 +99,8 @@ describe( 'SetupComplete', () => {
11099
'card',
111100
'bancontact',
112101
'eps',
113-
'giropay',
114102
'ideal',
115103
'p24',
116-
'sofort',
117104
'sepa_debit',
118105
],
119106
},
@@ -133,7 +120,7 @@ describe( 'SetupComplete', () => {
133120

134121
it( 'renders setup complete messaging when context value says that one payment method has been added', () => {
135122
useEnabledPaymentMethodIds.mockReturnValue( [
136-
[ 'card', 'giropay' ],
123+
[ 'card', 'ideal' ],
137124
() => null,
138125
] );
139126
render(
@@ -161,10 +148,8 @@ describe( 'SetupComplete', () => {
161148
const additionalMethods = [
162149
'bancontact',
163150
'eps',
164-
'giropay',
165151
'ideal',
166152
'p24',
167-
'sofort',
168153
'sepa_debit',
169154
];
170155
useEnabledPaymentMethodIds.mockReturnValue( [

client/checkout/utils/test/upe.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ describe( 'isUsingSavedPaymentMethod', () => {
859859
} );
860860

861861
test( 'non-tokenized payment gateway is selected', () => {
862-
const paymentMethodType = 'sofort';
862+
const paymentMethodType = 'ideal';
863863

864864
expect( isUsingSavedPaymentMethod( paymentMethodType ) ).toBe( false );
865865
} );

0 commit comments

Comments
 (0)