Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
## Integrations team

/packages/core/src/checkout-buttons/strategies/amazon-pay-v2 @bigcommerce/team-integrations
/packages/core/src/checkout-buttons/strategies/masterpass @bigcommerce/team-integrations
/packages/core/src/customer/strategies/amazon-pay-v2 @bigcommerce/team-integrations
/packages/core/src/customer/strategies/chasepay @bigcommerce/team-integrations
/packages/core/src/customer/strategies/masterpass @bigcommerce/team-integrations
/packages/core/src/customer/strategies/square @bigcommerce/team-integrations
/packages/core/src/shipping/strategies/amazon-pay-v2 @bigcommerce/team-integrations
/packages/core/src/shipping/strategies/stripe-upe @bigcommerce/team-integrations
Expand All @@ -33,7 +31,6 @@
/packages/core/src/payment/strategies/humm @bigcommerce/team-integrations
/packages/core/src/payment/strategies/klarna @bigcommerce/team-integrations
/packages/core/src/payment/strategies/klarnav2 @bigcommerce/team-integrations
/packages/core/src/payment/strategies/masterpass @bigcommerce/team-integrations
/packages/core/src/payment/strategies/moneris @bigcommerce/team-integrations
/packages/core/src/payment/strategies/ppsdk @bigcommerce/team-integrations
/packages/core/src/payment/strategies/quadpay @bigcommerce/team-integrations
Expand Down
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@
- [LineItemSocialData](interfaces/LineItemSocialData.md)
- [LinkStyles](interfaces/LinkStyles.md)
- [Locales](interfaces/Locales.md)
- [MasterpassCustomerInitializeOptions](interfaces/MasterpassCustomerInitializeOptions.md)
- [MasterpassPaymentInitializeOptions](interfaces/MasterpassPaymentInitializeOptions.md)
- [MolliePaymentInitializeOptions](interfaces/MolliePaymentInitializeOptions.md)
- [MutationObeserverCreator](interfaces/MutationObeserverCreator.md)
- [MutationObserverWindow](interfaces/MutationObserverWindow.md)
Expand Down
7 changes: 0 additions & 7 deletions docs/enums/CheckoutButtonMethodType.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
- [GOOGLEPAY_STRIPE](CheckoutButtonMethodType.md#googlepay_stripe)
- [GOOGLEPAY_STRIPEUPE](CheckoutButtonMethodType.md#googlepay_stripeupe)
- [GOOGLEPAY_WORLDPAYACCESS](CheckoutButtonMethodType.md#googlepay_worldpayaccess)
- [MASTERPASS](CheckoutButtonMethodType.md#masterpass)
- [PAYPALEXPRESS](CheckoutButtonMethodType.md#paypalexpress)

## Enumeration Members
Expand Down Expand Up @@ -123,12 +122,6 @@ ___

___

### MASTERPASS

• **MASTERPASS**

___

### PAYPALEXPRESS

• **PAYPALEXPRESS**
10 changes: 0 additions & 10 deletions docs/interfaces/BaseCustomerInitializeOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ information in order to initialize the customer step of checkout.
### Properties

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

___

### masterpass

• `Optional` **masterpass**: [`MasterpassCustomerInitializeOptions`](MasterpassCustomerInitializeOptions.md)

The options that are required to initialize the Masterpass payment method.
They can be omitted unless you need to support Masterpass.

___

### methodId

• `Optional` **methodId**: `string`
Expand Down
10 changes: 0 additions & 10 deletions docs/interfaces/BasePaymentInitializeOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ current checkout flow.
- [creditCard](BasePaymentInitializeOptions.md#creditcard)
- [gatewayId](BasePaymentInitializeOptions.md#gatewayid)
- [integrations](BasePaymentInitializeOptions.md#integrations)
- [masterpass](BasePaymentInitializeOptions.md#masterpass)
- [methodId](BasePaymentInitializeOptions.md#methodid)
- [params](BasePaymentInitializeOptions.md#params)
- [timeout](BasePaymentInitializeOptions.md#timeout)
Expand Down Expand Up @@ -58,15 +57,6 @@ ___

___

### masterpass

• `Optional` **masterpass**: [`MasterpassPaymentInitializeOptions`](MasterpassPaymentInitializeOptions.md)

The options that are required to initialize the Masterpass payment method.
They can be omitted unless you need to support Masterpass.

___

### methodId

• **methodId**: `string`
Expand Down
3 changes: 0 additions & 3 deletions docs/interfaces/CheckoutButtonState.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
| `googlepaystripe` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
| `masterpass` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |
| `paypalexpress` | `undefined` \| [`CheckoutButtonDataState`](CheckoutButtonDataState.md) |

___
Expand Down Expand Up @@ -65,7 +64,6 @@ ___
| `googlepaystripe` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
| `masterpass` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |
| `paypalexpress` | `undefined` \| [`CheckoutButtonErrorsState`](CheckoutButtonErrorsState.md) |

___
Expand Down Expand Up @@ -94,5 +92,4 @@ ___
| `googlepaystripe` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
| `googlepaystripeupe` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
| `googlepayworldpayaccess` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
| `masterpass` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
| `paypalexpress` | `undefined` \| [`CheckoutButtonStatusesState`](CheckoutButtonStatusesState.md) |
17 changes: 0 additions & 17 deletions docs/interfaces/MasterpassCustomerInitializeOptions.md

This file was deleted.

35 changes: 0 additions & 35 deletions docs/interfaces/MasterpassPaymentInitializeOptions.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('CheckoutButtonInitializer', () => {
store = createCheckoutStore();

buttonActionCreator = new CheckoutButtonStrategyActionCreator(
createCheckoutButtonRegistry(store, createRequestSender(), createFormPoster(), 'en'),
createCheckoutButtonRegistry(store, createRequestSender(), createFormPoster()),
Copy link

@BC-krasnoshapka BC-krasnoshapka Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bc-wpietrzak is removing locale here and in other tests intended?

createCheckoutButtonRegistryV2(createPaymentIntegrationService(store), {}),
new PaymentMethodActionCreator(new PaymentMethodRequestSender(createRequestSender())),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
strategy = new MockButtonStrategy();
store = createCheckoutStore();
registryV2 = createCheckoutButtonRegistryV2(createPaymentIntegrationService(store), {});
registry.register(CheckoutButtonMethodType.MASTERPASS, () => strategy);
registry.register(CheckoutButtonMethodType.PAYPALEXPRESS, () => strategy);

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

options = {
methodId: CheckoutButtonMethodType.MASTERPASS,
methodId: CheckoutButtonMethodType.PAYPALEXPRESS,
containerId: 'checkout-button',
};

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

expect(paymentMethodActionCreator.loadPaymentMethod).toHaveBeenCalledWith(
CheckoutButtonMethodType.MASTERPASS,
CheckoutButtonMethodType.PAYPALEXPRESS,
{ useCache: true },
);
});

it('loads required payment method for provided currency', async () => {
const optionsMock = {
methodId: CheckoutButtonMethodType.MASTERPASS,
methodId: CheckoutButtonMethodType.PAYPALEXPRESS,
containerId: 'checkout-button',
currencyCode: 'USD',
};
Expand All @@ -103,7 +103,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
};

expect(paymentMethodActionCreator.loadPaymentMethod).toHaveBeenCalledWith(
CheckoutButtonMethodType.MASTERPASS,
CheckoutButtonMethodType.PAYPALEXPRESS,
expectedPaymentMethodOptions,
);
});
Expand All @@ -114,7 +114,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {

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

expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
expect(strategy.initialize).toHaveBeenCalledWith(options);
});

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

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

expect(registry.get).not.toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
expect(registry.get).not.toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
expect(strategy.initialize).not.toHaveBeenCalledWith(options);
});

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

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

Expand Down Expand Up @@ -207,7 +207,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {
});

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

Expand Down Expand Up @@ -260,7 +260,7 @@ describe('CheckoutButtonStrategyActionCreator', () => {

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

expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.MASTERPASS);
expect(registry.get).toHaveBeenCalledWith(CheckoutButtonMethodType.PAYPALEXPRESS);
expect(strategy.deinitialize).toHaveBeenCalled();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import createCheckoutButtonRegistryV2 from './create-checkout-button-registry-v2
export default function createCheckoutButtonInitializer(
options?: CheckoutButtonInitializerOptions,
): CheckoutButtonInitializer {
const { host, locale = 'en' } = options ?? {};
const { host } = options ?? {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bc-wpietrzak same here


const config: ConfigState = {
meta: {
Expand All @@ -64,7 +64,7 @@ export default function createCheckoutButtonInitializer(
return new CheckoutButtonInitializer(
store,
new CheckoutButtonStrategyActionCreator(
createCheckoutButtonRegistry(store, requestSender, formPoster, locale, host),
createCheckoutButtonRegistry(store, requestSender, formPoster, host),
registryV2,
new PaymentMethodActionCreator(new PaymentMethodRequestSender(requestSender)),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Registry } from '../common/registry';

import createCheckoutButtonRegistry from './create-checkout-button-registry';
import { CheckoutButtonStrategy } from './strategies';
import { MasterpassButtonStrategy } from './strategies/masterpass';
import { PaypalButtonStrategy } from './strategies/paypal';

describe('createCheckoutButtonRegistry', () => {
Expand All @@ -15,19 +14,10 @@ describe('createCheckoutButtonRegistry', () => {
beforeEach(() => {
const store = createCheckoutStore();

registry = createCheckoutButtonRegistry(
store,
createRequestSender(),
createFormPoster(),
'en',
);
registry = createCheckoutButtonRegistry(store, createRequestSender(), createFormPoster());
});

it('returns registry with PayPal Express registered', () => {
expect(registry.get('paypalexpress')).toEqual(expect.any(PaypalButtonStrategy));
});

it('returns registry with Masterpass registered', () => {
expect(registry.get('masterpass')).toEqual(expect.any(MasterpassButtonStrategy));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ import { CheckoutActionCreator, CheckoutRequestSender, CheckoutStore } from '../
import { Registry } from '../common/registry';
import { ConfigActionCreator, ConfigRequestSender } from '../config';
import { FormFieldsActionCreator, FormFieldsRequestSender } from '../form';
import { MasterpassScriptLoader } from '../payment/strategies/masterpass';
import { PaypalScriptLoader } from '../payment/strategies/paypal';

import { CheckoutButtonMethodType, CheckoutButtonStrategy } from './strategies';
import { MasterpassButtonStrategy } from './strategies/masterpass';
import { PaypalButtonStrategy } from './strategies/paypal';

export default function createCheckoutButtonRegistry(
store: CheckoutStore,
requestSender: RequestSender,
formPoster: FormPoster,
locale: string,
host?: string,
): Registry<CheckoutButtonStrategy, CheckoutButtonMethodType> {
const registry = new Registry<CheckoutButtonStrategy, CheckoutButtonMethodType>();
Expand All @@ -29,17 +26,6 @@ export default function createCheckoutButtonRegistry(
new FormFieldsActionCreator(new FormFieldsRequestSender(requestSender)),
);

registry.register(
CheckoutButtonMethodType.MASTERPASS,
() =>
new MasterpassButtonStrategy(
store,
checkoutActionCreator,
new MasterpassScriptLoader(scriptLoader),
locale,
),
);

registry.register(
CheckoutButtonMethodType.PAYPALEXPRESS,
() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export enum BaseCheckoutButtonMethodType {
GOOGLEPAY_STRIPE = 'googlepaystripe',
GOOGLEPAY_STRIPEUPE = 'googlepaystripeupe',
GOOGLEPAY_WORLDPAYACCESS = 'googlepayworldpayaccess',
MASTERPASS = 'masterpass',
PAYPALEXPRESS = 'paypalexpress',
}

This file was deleted.

Loading