Skip to content

Commit ff5f0ba

Browse files
authored
feat(payment): PI-3536 [FE] Deprecate Masterpass (#3085)
1 parent 60001a2 commit ff5f0ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+25
-2098
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
## Integrations team
1111

1212
/packages/core/src/checkout-buttons/strategies/amazon-pay-v2 @bigcommerce/team-integrations
13-
/packages/core/src/checkout-buttons/strategies/masterpass @bigcommerce/team-integrations
1413
/packages/core/src/customer/strategies/amazon-pay-v2 @bigcommerce/team-integrations
1514
/packages/core/src/customer/strategies/chasepay @bigcommerce/team-integrations
16-
/packages/core/src/customer/strategies/masterpass @bigcommerce/team-integrations
1715
/packages/core/src/customer/strategies/square @bigcommerce/team-integrations
1816
/packages/core/src/shipping/strategies/amazon-pay-v2 @bigcommerce/team-integrations
1917
/packages/core/src/shipping/strategies/stripe-upe @bigcommerce/team-integrations
@@ -33,7 +31,6 @@
3331
/packages/core/src/payment/strategies/humm @bigcommerce/team-integrations
3432
/packages/core/src/payment/strategies/klarna @bigcommerce/team-integrations
3533
/packages/core/src/payment/strategies/klarnav2 @bigcommerce/team-integrations
36-
/packages/core/src/payment/strategies/masterpass @bigcommerce/team-integrations
3734
/packages/core/src/payment/strategies/moneris @bigcommerce/team-integrations
3835
/packages/core/src/payment/strategies/ppsdk @bigcommerce/team-integrations
3936
/packages/core/src/payment/strategies/quadpay @bigcommerce/team-integrations

docs/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,6 @@
321321
- [LineItemSocialData](interfaces/LineItemSocialData.md)
322322
- [LinkStyles](interfaces/LinkStyles.md)
323323
- [Locales](interfaces/Locales.md)
324-
- [MasterpassCustomerInitializeOptions](interfaces/MasterpassCustomerInitializeOptions.md)
325-
- [MasterpassPaymentInitializeOptions](interfaces/MasterpassPaymentInitializeOptions.md)
326324
- [MolliePaymentInitializeOptions](interfaces/MolliePaymentInitializeOptions.md)
327325
- [MutationObeserverCreator](interfaces/MutationObeserverCreator.md)
328326
- [MutationObserverWindow](interfaces/MutationObserverWindow.md)

docs/enums/CheckoutButtonMethodType.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- [GOOGLEPAY_STRIPE](CheckoutButtonMethodType.md#googlepay_stripe)
2323
- [GOOGLEPAY_STRIPEUPE](CheckoutButtonMethodType.md#googlepay_stripeupe)
2424
- [GOOGLEPAY_WORLDPAYACCESS](CheckoutButtonMethodType.md#googlepay_worldpayaccess)
25-
- [MASTERPASS](CheckoutButtonMethodType.md#masterpass)
2625
- [PAYPALEXPRESS](CheckoutButtonMethodType.md#paypalexpress)
2726

2827
## Enumeration Members
@@ -123,12 +122,6 @@ ___
123122

124123
___
125124

126-
### MASTERPASS
127-
128-
**MASTERPASS**
129-
130-
___
131-
132125
### PAYPALEXPRESS
133126

134127
**PAYPALEXPRESS**

docs/interfaces/BaseCustomerInitializeOptions.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ information in order to initialize the customer step of checkout.
2525
### Properties
2626

2727
- [integrations](BaseCustomerInitializeOptions.md#integrations)
28-
- [masterpass](BaseCustomerInitializeOptions.md#masterpass)
2928
- [methodId](BaseCustomerInitializeOptions.md#methodid)
3029
- [params](BaseCustomerInitializeOptions.md#params)
3130
- [timeout](BaseCustomerInitializeOptions.md#timeout)
@@ -40,15 +39,6 @@ information in order to initialize the customer step of checkout.
4039

4140
___
4241

43-
### masterpass
44-
45-
`Optional` **masterpass**: [`MasterpassCustomerInitializeOptions`](MasterpassCustomerInitializeOptions.md)
46-
47-
The options that are required to initialize the Masterpass payment method.
48-
They can be omitted unless you need to support Masterpass.
49-
50-
___
51-
5242
### methodId
5343

5444
`Optional` **methodId**: `string`

docs/interfaces/BasePaymentInitializeOptions.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ current checkout flow.
1818
- [creditCard](BasePaymentInitializeOptions.md#creditcard)
1919
- [gatewayId](BasePaymentInitializeOptions.md#gatewayid)
2020
- [integrations](BasePaymentInitializeOptions.md#integrations)
21-
- [masterpass](BasePaymentInitializeOptions.md#masterpass)
2221
- [methodId](BasePaymentInitializeOptions.md#methodid)
2322
- [params](BasePaymentInitializeOptions.md#params)
2423
- [timeout](BasePaymentInitializeOptions.md#timeout)
@@ -58,15 +57,6 @@ ___
5857

5958
___
6059

61-
### masterpass
62-
63-
`Optional` **masterpass**: [`MasterpassPaymentInitializeOptions`](MasterpassPaymentInitializeOptions.md)
64-
65-
The options that are required to initialize the Masterpass payment method.
66-
They can be omitted unless you need to support Masterpass.
67-
68-
___
69-
7060
### methodId
7161

7262
**methodId**: `string`

docs/interfaces/CheckoutButtonState.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
| `googlepaystripe` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
3737
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
3838
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
39-
| `masterpass` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
4039
| `paypalexpress` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
4140

4241
___
@@ -65,7 +64,6 @@ ___
6564
| `googlepaystripe` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
6665
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
6766
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
68-
| `masterpass` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
6967
| `paypalexpress` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
7068

7169
___
@@ -94,5 +92,4 @@ ___
9492
| `googlepaystripe` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
9593
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
9694
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
97-
| `masterpass` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
9895
| `paypalexpress` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |

docs/interfaces/MasterpassCustomerInitializeOptions.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/interfaces/MasterpassPaymentInitializeOptions.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/core/src/checkout-buttons/checkout-button-initializer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('CheckoutButtonInitializer', () => {
2525
store = createCheckoutStore();
2626

2727
buttonActionCreator = new CheckoutButtonStrategyActionCreator(
28-
createCheckoutButtonRegistry(store, createRequestSender(), createFormPoster(), 'en'),
28+
createCheckoutButtonRegistry(store, createRequestSender(), createFormPoster()),
2929
createCheckoutButtonRegistryV2(createPaymentIntegrationService(store), {}),
3030
new PaymentMethodActionCreator(new PaymentMethodRequestSender(createRequestSender())),
3131
);

packages/core/src/checkout-buttons/checkout-button-strategy-action-creator.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
4949
strategy = new MockButtonStrategy();
5050
store = createCheckoutStore();
5151
registryV2 = createCheckoutButtonRegistryV2(createPaymentIntegrationService(store), {});
52-
registry.register(CheckoutButtonMethodType.MASTERPASS, () => strategy);
52+
registry.register(CheckoutButtonMethodType.PAYPALEXPRESS, () => strategy);
5353

5454
jest.spyOn(paymentMethodActionCreator, 'loadPaymentMethod').mockReturnValue(() =>
5555
// TODO: remove ts-ignore and update test with related type (PAYPAL-4383)
@@ -64,7 +64,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
6464
);
6565

6666
options = {
67-
methodId: CheckoutButtonMethodType.MASTERPASS,
67+
methodId: CheckoutButtonMethodType.PAYPALEXPRESS,
6868
containerId: 'checkout-button',
6969
};
7070

@@ -79,14 +79,14 @@ describe('CheckoutButtonStrategyActionCreator', () => {
7979
await from(strategyActionCreator.initialize(options)(store)).pipe(toArray()).toPromise();
8080

8181
expect(paymentMethodActionCreator.loadPaymentMethod).toHaveBeenCalledWith(
82-
CheckoutButtonMethodType.MASTERPASS,
82+
CheckoutButtonMethodType.PAYPALEXPRESS,
8383
{ useCache: true },
8484
);
8585
});
8686

8787
it('loads required payment method for provided currency', async () => {
8888
const optionsMock = {
89-
methodId: CheckoutButtonMethodType.MASTERPASS,
89+
methodId: CheckoutButtonMethodType.PAYPALEXPRESS,
9090
containerId: 'checkout-button',
9191
currencyCode: 'USD',
9292
};
@@ -103,7 +103,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
103103
};
104104

105105
expect(paymentMethodActionCreator.loadPaymentMethod).toHaveBeenCalledWith(
106-
CheckoutButtonMethodType.MASTERPASS,
106+
CheckoutButtonMethodType.PAYPALEXPRESS,
107107
expectedPaymentMethodOptions,
108108
);
109109
});
@@ -114,7 +114,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
114114

115115
await from(strategyActionCreator.initialize(options)(store)).pipe(toArray()).toPromise();
116116

117-
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
117+
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
118118
expect(strategy.initialize).toHaveBeenCalledWith(options);
119119
});
120120

@@ -138,12 +138,12 @@ describe('CheckoutButtonStrategyActionCreator', () => {
138138

139139
await from(strategyActionCreator.initialize(options)(store)).pipe(toArray()).toPromise();
140140

141-
expect(registry.get).not.toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
141+
expect(registry.get).not.toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
142142
expect(strategy.initialize).not.toHaveBeenCalledWith(options);
143143
});
144144

145145
it('emits actions indicating initialization progress', async () => {
146-
const methodId = CheckoutButtonMethodType.MASTERPASS;
146+
const methodId = CheckoutButtonMethodType.PAYPALEXPRESS;
147147
const containerId = 'checkout-button';
148148
const actions = await from(
149149
strategyActionCreator.initialize({ methodId, containerId })(store),
@@ -169,7 +169,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
169169
});
170170

171171
it('throws error if unable to load required payment method', async () => {
172-
const methodId = CheckoutButtonMethodType.MASTERPASS;
172+
const methodId = CheckoutButtonMethodType.PAYPALEXPRESS;
173173
const containerId = 'checkout-button';
174174
const expectedError = new Error('Unable to load payment method');
175175

@@ -207,7 +207,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
207207
});
208208

209209
it('throws error if unable to initialize strategy', async () => {
210-
const methodId = CheckoutButtonMethodType.MASTERPASS;
210+
const methodId = CheckoutButtonMethodType.PAYPALEXPRESS;
211211
const containerId = 'checkout-button';
212212
const expectedError = new Error('Unable to initialize strategy');
213213

@@ -260,7 +260,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
260260

261261
await from(strategyActionCreator.deinitialize(options)(store)).pipe(toArray()).toPromise();
262262

263-
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
263+
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
264264
expect(strategy.deinitialize).toHaveBeenCalled();
265265
});
266266

0 commit comments

Comments
 (0)