Skip to content

Commit

Permalink
chore: remove admin deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
cyl3x committed Jan 30, 2025
1 parent 4b0c8fe commit c15cb8d
Show file tree
Hide file tree
Showing 85 changed files with 102 additions and 6,443 deletions.
99 changes: 98 additions & 1 deletion src/Resources/Schema/AdminApi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,42 @@
}
}
},
"/api/_action/paypal/test-api-credentials": {
"post": {
"tags": [
"Admin Api",
"PayPal"
],
"operationId": "testApiCredentials",
"responses": {
"200": {
"description": "Returns if the provided API credentials are valid",
"content": {
"application/json": {
"schema": {
"required": [
"valid",
"errors"
],
"properties": {
"valid": {
"type": "boolean"
},
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error"
}
}
},
"type": "object"
}
}
}
}
}
}
},
"/api/_action/paypal/get-api-credentials": {
"post": {
"tags": [
Expand Down Expand Up @@ -1283,6 +1319,30 @@
}
}
},
"/api/_action/paypal/save-settings": {
"post": {
"tags": [
"Admin Api",
"PayPal"
],
"operationId": "saveSettings",
"responses": {
"200": {
"description": "Returns information about the saved settings",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/swag_paypal_setting_settings_information"
}
}
}
}
}
}
}
},
"/api/_action/paypal/webhook/status/{salesChannelId}": {
"get": {
"tags": [
Expand Down Expand Up @@ -6703,7 +6763,12 @@
],
"properties": {
"merchantIntegrations": {
"$ref": "#/components/schemas/swag_paypal_v1_merchant_integrations"
"oneOf": [
{
"$ref": "#/components/schemas/swag_paypal_v1_merchant_integrations"
}
],
"nullable": true
},
"capabilities": {
"description": "string> key: paymentMethodId, value: capability (see AbstractMethodData)",
Expand All @@ -6714,6 +6779,38 @@
}
},
"type": "object"
},
"swag_paypal_setting_settings_information": {
"required": [
"sandboxCredentialsChanged",
"sandboxCredentialsValid",
"liveCredentialsChanged",
"liveCredentialsValid",
"webhookErrors"
],
"properties": {
"sandboxCredentialsChanged": {
"type": "boolean"
},
"sandboxCredentialsValid": {
"type": "boolean",
"nullable": true
},
"liveCredentialsChanged": {
"type": "boolean"
},
"liveCredentialsValid": {
"type": "boolean",
"nullable": true
},
"webhookErrors": {
"type": "array",
"items": {
"type": "string"
}
}
},
"type": "object"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion src/Resources/app/administration/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'SwagPayPal/mixin/swag-paypal-credentials-loader.mixin';
import 'SwagPayPal/mixin/swag-paypal-notification.mixin';
import 'SwagPayPal/mixin/swag-paypal-pos-catch-error.mixin';
import 'SwagPayPal/mixin/swag-paypal-pos-log-label.mixin';
Expand Down
10 changes: 0 additions & 10 deletions src/Resources/app/administration/src/app/store/settings.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ const Default = {

'SwagPayPal.settings.crossBorderMessagingEnabled': false,
'SwagPayPal.settings.crossBorderBuyerCountry': null,

/**
* @deprecated tag:v10.0.0 - Will be removed without replacement.
*/
'SwagPayPal.settings.merchantLocation': 'other',

/**
* @deprecated tag:v10.0.0 - Will be removed without replacement.
*/
'SwagPayPal.settings.plusCheckoutEnabled': false,
} satisfies PayPal.SystemConfig;

const All = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,6 @@ export const SYSTEM_CONFIGS = [

'SwagPayPal.settings.webhookId',
'SwagPayPal.settings.webhookExecuteToken',


/**
* @deprecated tag:v10.0.0 - Will be removed without replacement.
*/
'SwagPayPal.settings.merchantLocation',

/**
* @deprecated tag:v10.0.0 - Will be removed without replacement.
*/
'SwagPayPal.settings.plusCheckoutEnabled',
] as const;

export type SYSTEM_CONFIG = typeof SYSTEM_CONFIGS[number];

This file was deleted.

4 changes: 0 additions & 4 deletions src/Resources/app/administration/src/global.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import type Criteria from 'src/core/data/criteria.data';
import type { Entity } from 'SwagPayPal/types/entity';
import type { PropType as TPropType } from 'vue';
import type SwagPaypalNotificationMixin from './mixin/swag-paypal-notification.mixin';
import type SwagPaypalCredentialsLoaderMixin from './mixin/swag-paypal-credentials-loader.mixin';
import type SwagPaypalPosCatchErrorMixin from './mixin/swag-paypal-pos-catch-error.mixin';
import type SwagPaypalPosLogLabelMixin from './mixin/swag-paypal-pos-log-label.mixin';
import type SwagPaypalSettingsMixin from './mixin/swag-paypal-settings.mixin';
import type SwagPaypalMerchantInformationMixin from './mixin/swag-paypal-merchant-information.mixin';
import type SwagPayPalApiCredentialsService from './core/service/api/swag-paypal-api-credentials.service';
import type SwagPayPalDisputeApiService from './core/service/api/swag-paypal-dispute.api.service';
import type SwagPayPalOrderService from './core/service/api/swag-paypal-order.service';
import type SwagPaypalPaymentMethodService from './core/service/api/swag-paypal-payment-method.service';
Expand All @@ -30,7 +28,6 @@ declare global {
type PropType<T> = TPropType<T>;

interface MixinContainer {
'swag-paypal-credentials-loader': typeof SwagPaypalCredentialsLoaderMixin;
'swag-paypal-notification': typeof SwagPaypalNotificationMixin;
'swag-paypal-pos-catch-error': typeof SwagPaypalPosCatchErrorMixin;
'swag-paypal-pos-log-label': typeof SwagPaypalPosLogLabelMixin;
Expand All @@ -39,7 +36,6 @@ declare global {
}

interface ServiceContainer {
SwagPayPalApiCredentialsService: SwagPayPalApiCredentialsService;
SwagPayPalPosSettingApiService: SwagPayPalPosSettingApiService;
SwagPayPalPosApiService: SwagPayPalPosApiService;
SwagPayPalPosWebhookRegisterService: SwagPayPalPosWebhookRegisterService;
Expand Down
6 changes: 0 additions & 6 deletions src/Resources/app/administration/src/init/api-service.init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import SwagPayPalApiCredentialsService from '../core/service/api/swag-paypal-api-credentials.service';
import SwagPayPalPosSettingApiService from '../core/service/api/swag-paypal-pos-setting.api.service';
import SwagPayPalPosApiService from '../core/service/api/swag-paypal-pos.api.service';
import SwagPayPalPosWebhookRegisterService from '../core/service/api/swag-paypal-pos-webhook-register.service';
Expand All @@ -13,11 +12,6 @@ const { Application } = Shopware;

const initContainer = Application.getContainer('init');

Application.addServiceProvider(
'SwagPayPalApiCredentialsService',
(container) => new SwagPayPalApiCredentialsService(initContainer.httpClient, container.loginService),
);

Application.addServiceProvider(
'SwagPayPalPosSettingApiService',
(container) => new SwagPayPalPosSettingApiService(initContainer.httpClient, container.loginService),
Expand Down
54 changes: 3 additions & 51 deletions src/Resources/app/administration/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ui } from '@shopware-ag/meteor-admin-sdk';
import './app';

import './mixin/swag-paypal-credentials-loader.mixin';
import './mixin/swag-paypal-notification.mixin';
import './mixin/swag-paypal-pos-catch-error.mixin';
import './mixin/swag-paypal-pos-log-label.mixin';
Expand All @@ -9,58 +8,11 @@ import './mixin/swag-paypal-merchant-information.mixin';

import './module/extension';
import './module/swag-paypal-disputes';
import './module/swag-paypal-method';
import './module/swag-paypal-payment';
import './module/swag-paypal-pos';
import './module/swag-paypal-settings';

import './init/api-service.init';
import './init/translation.init';
import './init/svg-icons.init';

const bootPromise = window.Shopware ? Shopware.Plugin.addBootPromise() : () => {};

(async () => {
if (Shopware.Feature.isActive('PAYPAL_SETTINGS_TWEAKS')) {
await import('./app');
// @ts-expect-error - yes it's not a module
await import('./module/swag-paypal-settings');
// @ts-expect-error - yes it's not a module
await import('./module/swag-paypal-method');
} else {
await import('./module/swag-paypal');
}

// @ts-expect-error - bootPromise has a wrong doc type
bootPromise();
})();

if (!Shopware.Feature.isActive('PAYPAL_SETTINGS_TWEAKS')) {
/**
* @deprecated tag:v10.0.0 - Will be replaced by `swag-paypal-method`
*/
ui.module.payment.overviewCard.add({
positionId: 'swag-paypal-overview-card-before',
component: 'swag-paypal-overview-card',
paymentMethodHandlers: [
'handler_swag_trustlyapmhandler',
'handler_swag_sofortapmhandler',
'handler_swag_p24apmhandler',
'handler_swag_oxxoapmhandler',
'handler_swag_mybankapmhandler',
'handler_swag_multibancoapmhandler',
'handler_swag_idealapmhandler',
'handler_swag_giropayapmhandler',
'handler_swag_epsapmhandler',
'handler_swag_blikapmhandler',
'handler_swag_bancontactapmhandler',
'handler_swag_sepahandler',
'handler_swag_acdchandler',
'handler_swag_puihandler',
'handler_swag_paypalpaymenthandler',
'handler_swag_pospayment',
'handler_swag_venmohandler',
'handler_swag_paylaterhandler',
'handler_swag_applepayhandler',
'handler_swag_googlepayhandler',
],
});
}
Loading

0 comments on commit c15cb8d

Please sign in to comment.