Honor development environments
shane-scalable opened this issue · 0 comments
Has there been any thought given to development environment handling?
I didn't anything with a quick scan so I added a property to the src/ShipStation.php of:
private $devel_uri = 'private-anon-74400a3262-shipstation.apiary-mock.com';
Then in the constructor I updated the 'base_uri' initialization to use a ternary operator checking the environment and then using the appropriate api endpoint:
parent::__construct([ 'base_uri' => (App::environment() == 'production') ? $this->base_uri : $this->devel_uri,
This is a temporary solution for me until I (or someone else if they feel up to it) has time to create a pull request with a cleaner solution.
Update: It looks like the 'sandbox' api doesn't accept connections outside of the apiary domain, which makes this irrelevant. It looks like I will have to bug ShipStation about this one sorry.