lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
MIT License
307 stars 130 forks source link

Add United Arab Emirates to 1.6 release #139

Closed jasonwells closed 4 years ago

jasonwells commented 4 years ago

We are on the 1.6 release cycle of Peddler currently, and need to add UAE support. It's the same code change that was done for the endpoint in the 2 branch. I branched from 1.6.7, which I'm not sure is in master.

That is why I believe there are more changes I didn't make in the merge instead of just one line in lib/peddler/marketplace.rb.

Let me know if there is anything else I can do.

hakanensari commented 4 years ago

@jasonwells, this will open up the Pandora's box of maintaining the 1.0 branch. It would perhaps be easier to patch up Peddler in runtime?

Peddler::Marketplace.all << Peddler::Marketplace.new('A2VIGQ35RCS4UG',
                                                     'AE',
                                                     'mws.amazonservices.ae')
natesalisbury commented 4 years ago

Looks like Marketplace is setup differently in v1. This is what ended up working for a patch:

Peddler::Marketplace::IDS = Peddler::Marketplace::IDS.merge({'AE' => 'A2VIGQ35RCS4UG'})
Peddler::Marketplace::IDS.freeze

Peddler::Marketplace::HOSTS = Peddler::Marketplace::HOSTS.merge({'AE' => 'mws.amazonservices.ae'})
Peddler::Marketplace::HOSTS.freeze