Skip to content

Commit

Permalink
fix: change EU Seller Central URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit authored and moltar committed Jul 20, 2021
1 parent 0a980d4 commit e9284e3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
3 changes: 3 additions & 0 deletions src/european-seller-central-uri-factory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function europeanSellerCentralUriFactory(): string {
return 'https://sellercentral-europe.amazon.com'
}
3 changes: 2 additions & 1 deletion src/marketplaces/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion src/marketplaces/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/marketplaces/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/marketplaces/gb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/marketplaces/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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: {
Expand Down
20 changes: 10 additions & 10 deletions test/__snapshots__/marketplaces.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ 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",
"code": "EU",
"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",
Expand Down Expand Up @@ -259,15 +259,15 @@ 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",
"code": "EU",
"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",
Expand Down Expand Up @@ -301,15 +301,15 @@ 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",
"code": "EU",
"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",
Expand Down Expand Up @@ -343,15 +343,15 @@ 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",
"code": "EU",
"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",
Expand Down Expand Up @@ -406,15 +406,15 @@ 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",
"code": "EU",
"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",
Expand Down

0 comments on commit e9284e3

Please sign in to comment.