From e9284e3009e63ddf7d44ac4dad40a868ba9dabc5 Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Tue, 20 Jul 2021 14:08:57 +0700 Subject: [PATCH] fix: change EU Seller Central URIs --- src/european-seller-central-uri-factory.ts | 3 +++ src/marketplaces/de.ts | 3 ++- src/marketplaces/es.ts | 3 ++- src/marketplaces/fr.ts | 3 ++- src/marketplaces/gb.ts | 3 ++- src/marketplaces/it.ts | 3 ++- test/__snapshots__/marketplaces.test.ts.snap | 20 ++++++++++---------- 7 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 src/european-seller-central-uri-factory.ts diff --git a/src/european-seller-central-uri-factory.ts b/src/european-seller-central-uri-factory.ts new file mode 100644 index 00000000..df4ebd1a --- /dev/null +++ b/src/european-seller-central-uri-factory.ts @@ -0,0 +1,3 @@ +export function europeanSellerCentralUriFactory(): string { + return 'https://sellercentral-europe.amazon.com' +} diff --git a/src/marketplaces/de.ts b/src/marketplaces/de.ts index 47a4cc31..3908a57f 100644 --- a/src/marketplaces/de.ts +++ b/src/marketplaces/de.ts @@ -5,6 +5,7 @@ import { AmazonMarketplaceCountryCode, } from '../amazon-marketplace' import { europeanAdvertisingFactory } from '../european-advertising-factory' +import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' export const DE = new AmazonMarketplace({ @@ -13,7 +14,7 @@ export const DE = new AmazonMarketplace({ id: 'A1PA6795UKMFR9', name: 'Germany', uri: 'https://www.amazon.de', - sellerCentralUri: 'https://sellercentral.amazon.de', + sellerCentralUri: europeanSellerCentralUriFactory(), webServiceUri: 'https://mws-eu.amazonservices.com', advertising: europeanAdvertisingFactory(AmazonMarketplaceAdvertisingCountryCode.DE), sellingPartner: { diff --git a/src/marketplaces/es.ts b/src/marketplaces/es.ts index 5190b4e8..de649212 100644 --- a/src/marketplaces/es.ts +++ b/src/marketplaces/es.ts @@ -5,6 +5,7 @@ import { AmazonMarketplaceCountryCode, } from '../amazon-marketplace' import { europeanAdvertisingFactory } from '../european-advertising-factory' +import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' export const ES = new AmazonMarketplace({ @@ -14,7 +15,7 @@ export const ES = new AmazonMarketplace({ name: 'Spain', uri: 'https://www.amazon.es', webServiceUri: 'https://mws-eu.amazonservices.com', - sellerCentralUri: 'https://sellercentral.amazon.es', + sellerCentralUri: europeanSellerCentralUriFactory(), advertising: europeanAdvertisingFactory(AmazonMarketplaceAdvertisingCountryCode.ES), sellingPartner: { region: sellingPartnerRegions.EU, diff --git a/src/marketplaces/fr.ts b/src/marketplaces/fr.ts index d81947a2..c0aa2eaa 100644 --- a/src/marketplaces/fr.ts +++ b/src/marketplaces/fr.ts @@ -5,6 +5,7 @@ import { AmazonMarketplaceCountryCode, } from '../amazon-marketplace' import { europeanAdvertisingFactory } from '../european-advertising-factory' +import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' export const FR = new AmazonMarketplace({ @@ -14,7 +15,7 @@ export const FR = new AmazonMarketplace({ name: 'France', uri: 'https://www.amazon.fr', webServiceUri: 'https://mws-eu.amazonservices.com', - sellerCentralUri: 'https://sellercentral.amazon.fr', + sellerCentralUri: europeanSellerCentralUriFactory(), advertising: europeanAdvertisingFactory(AmazonMarketplaceAdvertisingCountryCode.FR), sellingPartner: { region: sellingPartnerRegions.EU, diff --git a/src/marketplaces/gb.ts b/src/marketplaces/gb.ts index 4d1b23d1..7d7c03e5 100644 --- a/src/marketplaces/gb.ts +++ b/src/marketplaces/gb.ts @@ -5,6 +5,7 @@ import { AmazonMarketplaceAdvertisingTimeZone, AmazonMarketplaceCountryCode, } from '../amazon-marketplace' +import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory' import { marketplaceAdvertisingRegions } from '../marketplace-advertising-regions' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' import { DE } from './de' @@ -19,7 +20,7 @@ export const GB = new AmazonMarketplace({ id: 'A1F83G8C2ARO7P', name: 'United Kingdom', uri: 'https://www.amazon.co.uk', - sellerCentralUri: 'https://sellercentral.amazon.co.uk', + sellerCentralUri: europeanSellerCentralUriFactory(), webServiceUri: DE.webServiceUri, advertising: { countryCode: AmazonMarketplaceAdvertisingCountryCode.UK, diff --git a/src/marketplaces/it.ts b/src/marketplaces/it.ts index ba62ad8b..ed5469e6 100644 --- a/src/marketplaces/it.ts +++ b/src/marketplaces/it.ts @@ -5,6 +5,7 @@ import { AmazonMarketplaceCountryCode, } from '../amazon-marketplace' import { europeanAdvertisingFactory } from '../european-advertising-factory' +import { europeanSellerCentralUriFactory } from '../european-seller-central-uri-factory' import { sellerCentralAuthUris, sellingPartnerRegions } from '../selling-partner-api-regions' export const IT = new AmazonMarketplace({ @@ -13,7 +14,7 @@ export const IT = new AmazonMarketplace({ id: 'APJ6JRA9NG5V4', name: 'Italy', uri: 'https://www.amazon.it', - sellerCentralUri: 'https://sellercentral.amazon.it', + sellerCentralUri: europeanSellerCentralUriFactory(), webServiceUri: 'https://mws-eu.amazonservices.com', advertising: europeanAdvertisingFactory(AmazonMarketplaceAdvertisingCountryCode.DE), sellingPartner: { diff --git a/test/__snapshots__/marketplaces.test.ts.snap b/test/__snapshots__/marketplaces.test.ts.snap index 4620194b..a8863b2d 100644 --- a/test/__snapshots__/marketplaces.test.ts.snap +++ b/test/__snapshots__/marketplaces.test.ts.snap @@ -206,7 +206,7 @@ AmazonMarketplace { "currency": "EUR", "id": "A1PA6795UKMFR9", "name": "Germany", - "sellerCentralUri": "https://sellercentral.amazon.de", + "sellerCentralUri": "https://sellercentral-europe.amazon.com", "sellingPartner": Object { "region": AmazonSellingPartnerApiRegion { "awsRegion": "eu-west-1", @@ -214,7 +214,7 @@ AmazonMarketplace { "endpoint": "https://sellingpartnerapi-eu.amazon.com", "name": "Europe", }, - "sellerCentralAuthUri": "https://sellercentral.amazon.de/apps/authorize/consent", + "sellerCentralAuthUri": "https://sellercentral-europe.amazon.com/apps/authorize/consent", }, "uri": "https://www.amazon.de", "webServiceUri": "https://mws-eu.amazonservices.com", @@ -259,7 +259,7 @@ AmazonMarketplace { "currency": "EUR", "id": "A1RKKUPIHCS9HS", "name": "Spain", - "sellerCentralUri": "https://sellercentral.amazon.es", + "sellerCentralUri": "https://sellercentral-europe.amazon.com", "sellingPartner": Object { "region": AmazonSellingPartnerApiRegion { "awsRegion": "eu-west-1", @@ -267,7 +267,7 @@ AmazonMarketplace { "endpoint": "https://sellingpartnerapi-eu.amazon.com", "name": "Europe", }, - "sellerCentralAuthUri": "https://sellercentral.amazon.es/apps/authorize/consent", + "sellerCentralAuthUri": "https://sellercentral-europe.amazon.com/apps/authorize/consent", }, "uri": "https://www.amazon.es", "webServiceUri": "https://mws-eu.amazonservices.com", @@ -301,7 +301,7 @@ AmazonMarketplace { "currency": "EUR", "id": "A13V1IB3VIYZZH", "name": "France", - "sellerCentralUri": "https://sellercentral.amazon.fr", + "sellerCentralUri": "https://sellercentral-europe.amazon.com", "sellingPartner": Object { "region": AmazonSellingPartnerApiRegion { "awsRegion": "eu-west-1", @@ -309,7 +309,7 @@ AmazonMarketplace { "endpoint": "https://sellingpartnerapi-eu.amazon.com", "name": "Europe", }, - "sellerCentralAuthUri": "https://sellercentral.amazon.fr/apps/authorize/consent", + "sellerCentralAuthUri": "https://sellercentral-europe.amazon.com/apps/authorize/consent", }, "uri": "https://www.amazon.fr", "webServiceUri": "https://mws-eu.amazonservices.com", @@ -343,7 +343,7 @@ AmazonMarketplace { "currency": "GBP", "id": "A1F83G8C2ARO7P", "name": "United Kingdom", - "sellerCentralUri": "https://sellercentral.amazon.co.uk", + "sellerCentralUri": "https://sellercentral-europe.amazon.com", "sellingPartner": Object { "region": AmazonSellingPartnerApiRegion { "awsRegion": "eu-west-1", @@ -351,7 +351,7 @@ AmazonMarketplace { "endpoint": "https://sellingpartnerapi-eu.amazon.com", "name": "Europe", }, - "sellerCentralAuthUri": "https://sellercentral.amazon.co.uk/apps/authorize/consent", + "sellerCentralAuthUri": "https://sellercentral-europe.amazon.com/apps/authorize/consent", }, "uri": "https://www.amazon.co.uk", "webServiceUri": "https://mws-eu.amazonservices.com", @@ -406,7 +406,7 @@ AmazonMarketplace { "currency": "EUR", "id": "APJ6JRA9NG5V4", "name": "Italy", - "sellerCentralUri": "https://sellercentral.amazon.it", + "sellerCentralUri": "https://sellercentral-europe.amazon.com", "sellingPartner": Object { "region": AmazonSellingPartnerApiRegion { "awsRegion": "eu-west-1", @@ -414,7 +414,7 @@ AmazonMarketplace { "endpoint": "https://sellingpartnerapi-eu.amazon.com", "name": "Europe", }, - "sellerCentralAuthUri": "https://sellercentral.amazon.it/apps/authorize/consent", + "sellerCentralAuthUri": "https://sellercentral-europe.amazon.com/apps/authorize/consent", }, "uri": "https://www.amazon.it", "webServiceUri": "https://mws-eu.amazonservices.com",