Giter Club home page Giter Club logo

Comments (6)

tarranjones avatar tarranjones commented on August 24, 2024

also constants in Constants\SiteIds are all ints but the config expects a string.
'siteId' => Constants\SiteIds::GB, gives me this error
Uncaught exception 'InvalidArgumentException' with message 'Invalid configuration value provided for "siteId". Expected string, but got

int 3 

for now ive just casted the const to a string

'siteId' => (string)Constants\SiteIds::GB,

from ebay-sdk-php.

davidtsadler avatar davidtsadler commented on August 24, 2024

Cheers for spotting these. I completely missed them. Will get them fixed in the next code push.

from ebay-sdk-php.

tarranjones avatar tarranjones commented on August 24, 2024

Sorry didn't want to open another issue but
for the getcategoryfeatures, eBay recommend that you

Retrieve all available data at most once a day for each site that you work with, and store the data locally.

so ideally I would create a trading service then loop through all the siteids that i work with. Each time modifying service->config[siteId] before making the getcategoryfeatures call.
I might have missed something but it looks like you have to create a new service if you want to use a different siteid, am i correct or can config be modified?
If not would it be possible to add some kind of setConfig($key, $val) or setSiteId method to \DTS\eBaySDK\Services\BaseService ?

from ebay-sdk-php.

tarranjones avatar tarranjones commented on August 24, 2024

possibly something like

private function setConfig($key, $val)
{

    $this->config[$key] = $val;
    //$resolver = new ConfigurationResolver(static::getConfigDefinitions());
    //$this->config = $resolver->resolve($this->config);
}

public function setSiteId($id)
{
    $this->setConfig('siteId', $id);

}
public function setGlobalId($id)
{
     $this->setConfig('globalId', $id);
}

from ebay-sdk-php.

davidtsadler avatar davidtsadler commented on August 24, 2024

As it stands at the moment you are correct in that you would have to create a new service with the required siteId during each iteration of the loop. Off the top of my head I can't think of any technical reason as to why the SDK can't let you modify configuration options after a service has been created. I'll look into it some more, just to double check, but I think that adding some sort of setConfig method may be the solution.

from ebay-sdk-php.

davidtsadler avatar davidtsadler commented on August 24, 2024

I've added a setConfig to the beta branch so in future it will be possible to change the configuration of a service object during its lifetime.

from ebay-sdk-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.