sonnenglas / amazon-mws-laravel

A library to connect to Amazon's MWS web services in an object oriented manner
Apache License 2.0
64 stars 73 forks source link

Handle store with multiple marketplaces #21

Open sahat81 opened 5 years ago

sahat81 commented 5 years ago

It should be possible to handle multiple marketplaces by defining marketplaceId as Array in store config file.

For example: in AmazonOrderList class, we can check if marketplaceId is Array then loop and set each ID to options[marketplaceId.Id.$x]

Dhavalptel commented 5 years ago

@sahat81 Exactly I've used same like this

'US' => [
            'merchantId'       => env('mwsMerchantId'),
            'marketplaceId'    => env('mwsMarketplaceId_US'),
            'keyId'            => env('mwsKeyId'),
            'secretKey'        => env('mwsSecretKey'),
            'mwsAuthToken'     => env('mwsAuthToken'),
            'amazonServiceUrl' => env('mwsAmazonServiceUrl_US'),
            'muteLog'          => env('mwsMuteLog', false),
        ],
        'CA' => [
            'merchantId'       => env('mwsMerchantId'),
            'marketplaceId'    => env('mwsMarketplaceId_CA'),
            'keyId'            => env('mwsKeyId'),
            'secretKey'        => env('mwsSecretKey'),
            'mwsAuthToken'     => env('mwsAuthToken'),
            'amazonServiceUrl' => env('mwsAmazonServiceUrl_CA'),
            'muteLog'          => env('mwsMuteLog', false),
        ],
        'UK' => [
            'merchantId'       => env('mwsMerchantId'),
            'marketplaceId'    => env('mwsMarketplaceId_UK'),
            'keyId'            => env('mwsKeyId'),
            'secretKey'        => env('mwsSecretKey'),
            'mwsAuthToken'     => env('mwsAuthToken'),
            'amazonServiceUrl' => env('mwsAmazonServiceUrl_UK'),
            'muteLog'          => env('mwsMuteLog', false),
        ],