Closed vaneavasco closed 6 years ago
I want to pass the dynamic credentials however component get credentials from config folder. Can you please let me know how Can I pass dynamic credentials ? e.g $amz = new AmazonOrderList("mystore"); It load the mystore array from config file. but here I want to pass all info from database. Thanks in advance.
@Gurpreet68 did you find a solution for this please give me idea of that
Just ignore the config folder, if you check out the AmazonCore class you can see that it gets config data from the Config facade:
public function setStore($s)
{
// if (file_exists($this->config)){
// include($this->config);
// } else {
// throw new \Exception("Config file does not exist!");
// }
$store = Config::get('amazon-mws.store');
You should do something like this in your own code to set the config data:
/**
* @param array $config
*
* @return $this
*/
public function setConfig(array $config)
{
$this->uniqueKey = $config['uniqueKey'];
Config::set(
'amazon-mws.store.' . $this->uniqueKey,
[
'merchantId' => $config['merchantId'],
'marketplaceId' => $config['marketplaceId'],
'keyId' => $config['keyId'],
'secretKey' => $config['secretKey'],
'amazonServiceUrl' => $config['amazonServiceUrl'],
'authToken' => $config['authToken']
]
);
return $this;
}
The MWSAuthToken is used to make requests on behalf of other amazon users, useful for developers working on amazon mws apps.